How does your computer actually store data? How can it keep your documents and photos? And what about music and video?

Most of us will probably know that the data is saved onto a hard disk (or hard drive), but how exactly?

## How Do Computers Store Data?

Every picture, document or video has to be converted into binary numbers in order for the computer to be able to store them. A computer can’t save an image as such, but rather it saves the binary code for that image.

Binary numbers consist of only ones and zeros. Nothing else. And that’s the important part. **It can only be either a one or a zero**. It’s the hidden secret to how computers store data.

Every file (document, picture, video or piece of music) on your computer is stored as binary numbers. That glossy photograph or paper document that you can physically hold in your hand has to be converted into ones and zeros in order to be saved onto a computer.

### Binary Numbers.

Binary numbers are strange to us because we count in the decimal system, for instance, the decimal number 5 becomes 0101 in binary. The number 21 is 10101 and the number **42 is 101010**.

Although it looks weird, binary is just a different numbering system to decimal. For any given number that you can think of in decimal, there is a binary equivalent, rather like how Roman Numerals work.

For example, as I write this article the year is **2022**, but in Roman numerals, it would be written as **MMXXII** and in binary it would be **11111100110**.

So in typing out the date 2022 on your PC, what the computer “sees” is 11111100110. And it’s that binary number the computer will store.

### Letters Of The Alphabet In Binary.

That works easily enough for numbers, but what about the letters of the alphabet? How can they be stored as binary numbers?

A lot easier than you might think. If we assign a number, a decimal number. to every single letter of the alphabet, we can then convert those decimal numbers to binary numbers which the computer can then store.

Of course for that to work, everyone has to agree on what number to assign to which letter. To that end, the ASCII (American Standard Code for Information Interchange) table was produced.

Here you can see the capital letters A to G from the ASCII table, along with their assigned decimal and binary numbers.

To be clear, the decimal numbers are included for the benefit of us humans. It is the binary number column that the computer uses.

For example, if you were to type the capital letters **A**, **B** and **C**, the computer would “see” **01000001**, **01000010** and **01000011** respectively.

#### ASCII Table.

## How Do Computers Use Binary Numbers To Store Data?

Now that we know that everything on your computer is stored as binary code (ones and zeros), the next question is, “How does the computer store the binary code”?

After all, it’s easy for us to write down a bunch of ones and zeros using pen and paper, but how can a PC do that?

To answer that question, let me stretch your imagination a little.

By using the ASCII table, we already know that the capital letter **A **is represented by the binary number **01000001**. So the computer doesn’t have to save the letter A as such, it only needs to save the binary code for the letter A which is 01000001.

Looking at that binary number, there are 8 digits. 8 ones or zeros.

**Suppose we had 8 light bulbs**. A light bulb that’s turned off is a zero, and a light bulb that’s turned on is a one, then we could represent ones and zeros with the light bulbs

And if we turn them on or off in the correct order, then we “spell out” 01000001, which is the letter A.

Once we can spell out one letter, then we could also do it for more letters. We could spell out words, create sentences and paragraphs, and assuming we have enough light bulbs, we can create whole documents. Shakespeare in light bulbs

#### Fibre Optics.

At the end of the fibre optic cable is some form of light source that is flickering on and off at an incredibly fast rate. Each on or off represents a one or a zero.

## Storing Data On A PC.

Computers store data on a hard disk (or hard drive). There are currently two main types of hard disk, the newest are called SSDs (Solid State Drives) and the older types are called HDDs (Hard Disk Drives).

Although the technologies that operate the two types of drive are different, the actual principles of storing ones and zeros holds true for both of them.

#### Sign Up For Our News Email

Enjoying this guide?

If you haven’t already, then consider subscribing to the **At Home Computer **newsletter.

You don’t need to create any sort of account, so you won’t be asked for passwords etc.

### How Computers Store Data On Hard Disk Drives.

Hard disk drives (HDDs) consist of a spinning magnetic disk (or platter) and an arm that supports the read/write heads. If you open one up, they look like miniature record players (if anyone remembers those).

The disk (platter) consists of trillions of microscopically tiny areas of magnetism. Each tiny area can be either a North pole or a South pole. **North or South, One or Zero.**

A computer stores data on a hard disk drive by changing the polarity of the magnetic surface of the platter to represent either a one or a zero.

When the computer is reading from the disk, the arm moves across the disk and detects whether the magnetic area below it is a North pole (a one) or a South pole (a zero)

When the computer is storing data on the disk, or writing to the disk, as the arm moves across, it can change the polarity from North to South (one to zero), or South to North (zero to one).

### How Computers Store Data On Solid State Drives.

Newer computers often have solid state drives for data storage. SSDs are newer than hard disk drives. They don’t have any moving parts and don’t rely on magnetism to store data. Instead, all the data is stored electronically.

If you think of a simple battery, it can be either charged or discharged (flat or dead). A charged battery can be said to be a one and a discharged battery can be a zero.

SSDs consist of millions (or trillions) of cells which can be charged or discharged depending on whether the cell is storing a one or a zero.

Although this is a gross oversimplification of how SSDs work, the principle is good.

Computers save data on the SSD by charging or discharging the cells within the drive to represent ones & zeros..

#### Summary.

Computers use a variety of devices and technologies to store data. But the one thing they all have in common is that they all save a representation of either a one or a zero.

**Incidentally**, those ones and zeros are called bits, and when you’ve got 8 bits they’re called a byte. But that’s another story What Are Kilobytes, Megabytes, Gigabytes And Terabytes