How do computers store data? By holding a physical state that can be read back later. A flash cell traps electrons. A hard disk magnetizes a patch of cobalt alloy. A stick of memory holds a charge in a capacitor that leaks within milliseconds and must be refreshed thousands of times per second. Every file you have ever saved is one of those states, somewhere.
The abstraction is elegant; the physics underneath is stubbornly analog, which is why storage fails in the particular ways it does.
Bits Are Physical
A bit is a distinction, not a thing. It is “high or low voltage,” “magnetized one way or the other,” “charge present or absent.” The computer never sees a zero or a one; it sees a threshold being crossed.
That is why storage degrades. Charge leaks, magnetic domains drift, and cells wear out after a few thousand write cycles. Error correction codes exist because the physical layer is unreliable by nature, not by accident.
Counting in Two
Eight bits make a byte, which gives 256 possible values — enough for a character in the older ASCII set. Modern text uses UTF-8, which is backward compatible with ASCII and uses one to four bytes per character, so an emoji costs more space than the letter next to it.
Everything else is built by agreement. A JPEG is a defined arrangement of bytes, a PDF is another, and a file extension is just a hint about which arrangement to expect.
Units and the Missing Gigabytes
| Unit | Decimal (drive makers) | Binary (operating systems) |
|---|---|---|
| Kilobyte | 1,000 bytes | 1,024 bytes |
| Megabyte | 1,000,000 | 1,048,576 |
| Gigabyte | 1,000,000,000 | 1,073,741,824 |
| Terabyte | 1,000,000,000,000 | 1,099,511,627,776 |
A “1 TB” drive contains one trillion bytes. Windows divides by 1,099,511,627,776 and reports 931 GB. Both numbers are correct; they are counting different things. The gap widens as drives grow, which is why the complaint never quite goes away.
Spinning Disks and Flash
A hard drive stores bits as the orientation of magnetic domains on a platter spinning at 5,400 to 7,200 rpm. A read head floats a few nanometers above the surface, close enough that a speck of dust would be a crash. Sequential reads are fast; random reads cost a physical seek.
An SSD stores bits as trapped charge in NAND cells, with no moving parts. It finds any block in microseconds, which is why an old laptop feels new after the swap. The cost is wear: each cell tolerates a limited number of erases, so controllers spread writes across the drive and reserve spare capacity to replace failures.
The File System Is the Index
Storage hardware only knows blocks. The file system supplies names, folders, permissions, and timestamps, mapping a path like photos/2024/trip.jpg to a list of block numbers.
On most Unix-like systems that map lives in an inode; on Windows it lives in a master file table. Either way, the directory is a table of contents, and the data is elsewhere. Corrupt the table and the data can still be there, unreachable — which is exactly what file recovery tools exploit.
What Delete Actually Does
Deleting a file normally removes its pointer and marks the blocks as available. The bytes stay put until something overwrites them. That is why recovery works, and why “I deleted it” is not a security statement.
On an SSD, the TRIM command tells the controller which blocks are free so it can erase them in advance. That improves speed and helps wear leveling, and it also makes recovery less likely.
Why Data Rots
Given enough time, stored bits flip. Cosmic rays, heat, and ordinary leakage all contribute. Enterprise systems add checksums and redundant copies; consumer drives mostly do not, beyond the error correction built into the controller.
The practical rule is the 3-2-1 backup: three copies, on two kinds of media, with one off-site. Anyone who has lost a photo library already knows the reason for the rule.
So how do computers store data at the scale of a data center? The same way, repeated a few million times, with software layered on top to assume that any individual disk will fail today.
Keep Exploring
- How do batteries work? — the chemistry of moving charge
- What is cloud computing? — storage as a rented service
- How does memory work? — the biological version of the same problem



