A hard disk drive is a device used for the long-term storage of computer data (e.g., the operating system, programs, documents, music, and pictures). Data is stored magnetically on one or more rotating platters. Hard drives are non-volatile, meaning they retain stored information even when powered down. Modern consumer hard drive capacities range from several hundred gigabytes to a few terabytes. ‘Disk space’ may refer to the amount of unused space available on the hard drive.
Random-access memory, or RAM, is used to store open programs and the data those programs use while running. When a computer is turned on, operating system files are loaded into RAM from the hard drive. RAM data is stored electrically in capacitors within integrated circuits. Because it is a type of volatile memory, all data written to RAM is lost when the computer is turned off. Laptop and desktop PC’s typically come with between one and twelve gigabytes of RAM, making the amount of installed RAM a few hundred times smaller than the hard drive size.
Per gigabyte, hard drives are much cheaper than RAM. However, because they contain moving parts, hard drives are orders of magnitude slower than RAM when reading or writing data.