You count in tens because you have ten fingers. Computers count in twos because their circuits have two states. Programmers count in sixteens because it is a tidy shorthand for binary. None of these is the "real" way to count — they are all the same numbers, written in different bases. Here is how bases work, and why three of them run the modern world.

What a number base actually is

A number base is simply how many distinct digits a counting system uses before it rolls over to a new place. Decimal, base 10, uses the digits 0 through 9. When you run out of digits, you add a place to the left: after 9 comes 10, after 99 comes 100.

Binary, base 2, uses only 0 and 1. After 1 comes 10 — which in binary means two, not ten. After 11 (three) comes 100 (four). Hexadecimal, base 16, uses the digits 0 through 9 plus the letters A through F, where A is 10 and F is 15. After F comes 10 — which in hex means sixteen.

The base is written as a small subscript when it matters: 1010 in binary is written 10102, and FF in hex is FF16. Without the subscript, a number like 101 is ambiguous — it could be one hundred one in decimal, five in binary, or two hundred fifty-seven in hex.

Place value: the idea that makes every base work

Place value is the one idea behind all of this. In decimal, the places from right to left are worth 1, 10, 100, 1,000 — each ten times the last. The number 2,472 means 2 thousands, 4 hundreds, 7 tens, and 2 ones: 2 × 1000 + 4 × 100 + 7 × 10 + 2 × 1.

Every base works exactly the same way, with its own multiplier. In binary, the places are worth 1, 2, 4, 8, 16, 32, 64, 128 — each twice the last. So binary 101101 means 1 × 32 + 0 × 16 + 1 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 32 + 8 + 4 + 1 = 45.

In hex, the places are worth 1, 16, 256, 4,096 — each sixteen times the last. Hex 2F7 means 2 × 256 + 15 × 16 + 7 × 1 = 512 + 240 + 7 = 759. The mechanics never change; only the multiplier does.

Binary: the language of machines

Every computer, phone, and smart device in your life runs on binary, and the reason is physical. A transistor is either on or off, a voltage is either high or low, a magnetic spot points one way or the other. Two states per digit is what hardware can do reliably, billions of times a second.

Counting in binary looks strange at first: 0, 1, 10, 11, 100, 101, 110, 111, 1000. But it follows the same rhythm as decimal — you just run out of digits sooner. Eight binary digits, called a byte, can hold 256 different values, from 0 to 255, which is why file sizes, memory, and color depths all come in powers of two.

Hexadecimal: binary's readable shorthand

Binary is precise but unreadable: 111111110000000011110000 is a perfectly good number, but no human wants to read it. Hexadecimal fixes that. Each hex digit represents exactly four binary digits, so a long binary string collapses to a quarter of its length. That same number in hex is FF00F0 — shorter, easier to read, and easy to convert back digit by digit.

Converting between binary and hex is the one conversion you can do by eye. Split the binary into groups of four from the right: 1111 1111 0000 0000 1111 0000 becomes F F 0 0 F 0. Each group of four bits maps to one hex digit, and the table is small enough to memorize: 0000 is 0, 1000 is 8, 1010 is A, 1111 is F.

Hex shows up more often than most people realize. Web colors are hex: #FF5733 is a warm orange-red, with FF for red, 57 for green, and 33 for blue. Wi-Fi network addresses, device identifiers, and software error codes are hex too.

Converting between bases: the two directions

Converting from any base to decimal uses place value: multiply each digit by its place value and add. Converting from decimal to another base uses repeated division — divide by the base, write down the remainder, divide the quotient again, and repeat until the quotient is zero. Then read the remainders bottom to top.

Worked example: convert 45 to binary. Divide by 2 repeatedly and record the remainders: 45 gives 22 r1, 11 r0, 5 r1, 2 r1, 1 r0, 0 r1. Read the remainders bottom to top: 101101. Check: 32 + 8 + 4 + 1 = 45.

Convert 759 to hex the same way. 759 ÷ 16 = 47 remainder 7. 47 ÷ 16 = 2 remainder 15, which is F. 2 ÷ 16 = 0 remainder 2. Read bottom to top: 2F7 — which matches the place-value calculation from earlier.

Why this matters even if you never program

You do not need to convert bases by hand to use a computer. But understanding them explains things that otherwise look like magic: why a color code is six characters, why a file is 1,024 kilobytes instead of 1,000, and why an IP address has four numbers from 0 to 255.

The deeper lesson is that decimal is not the natural way to count — it is the way that fits human hands. Machines count in twos and programmers read in sixteens. The numbers are the same; only the packaging changes.

AdvertisementAd slot: in-content

Frequently asked questions

Why do computers use binary instead of decimal?

A computer's circuits have two stable states — on and off, high voltage and low voltage — so base 2 maps directly onto hardware. Decimal would need ten distinct voltage levels per digit, which is far harder to build reliably. Binary is not a choice; it is what the physics allows.

What is hexadecimal used for in everyday life?

Most visibly, in color codes: #FF5733 is a web color written in hex, with two digits each for red, green, and blue. Hex also appears in Wi-Fi passwords, MAC addresses, memory addresses, and error codes. Anywhere a compact way to write binary is needed, hex shows up.

How do I convert binary to decimal by hand?

Write the place values above the digits — 1, 2, 4, 8, 16, 32, and so on, doubling right to left — then add up the place values where the digit is 1. For 1011, the ones are at 8, 2, and 1, so the value is 8 + 2 + 1 = 11.

Why does hex use letters A through F?

Hexadecimal needs sixteen digits, but we only have ten numeral symbols. The letters A through F supply the six extra digits: A is 10, B is 11, C is 12, D is 13, E is 14, and F is 15. One hex digit therefore holds exactly four bits of binary.