Hexadecimal Explained: Why Developers Count in 16s

By AutonomiQ Editorial TeamPublished 2026-07-21 · 7 min readEditorial standardsAutonomiQ Editorial Team
Hexadecimal Explained: Why Developers Count in 16s

Hexadecimal is base-16: instead of the ten digits 0–9 we use in everyday counting, hex adds six more — A, B, C, D, E, F — to represent the values ten through fifteen. It shows up constantly in tech (think #FF5733 colors), and the reason is elegant once you see it.

Why 16, of all numbers?

Computers think in binary — ones and zeros — but long strings of bits are miserable for humans to read. Here is the trick: exactly four binary digits (a “nibble”) map to exactly one hex digit. So the byte 1111 0101 becomes the tidy F5. Hex is not more “computery” than decimal; it is simply the most compact human-readable shorthand for binary, which is why it is everywhere in low-level tech.

Reading a hex number

Each position is a power of 16. Take 2F: the 2 is in the 16s place and F (which is 15) is in the 1s place, so 2F = 2×16 + 15 = 47 in decimal. Going the other way, 255 in decimal is FF in hex — the largest value a single byte can hold, which is exactly why color channels run 00–FF.

Where you actually meet hex

Colors: a CSS color like #FF5733 is three bytes — red FF (255), green 57 (87), blue 33 (51). Character codes: Unicode code points are written as U+1F600 (that is an emoji). Hashes and IDs: MD5, SHA and Git commit hashes are printed in hex because it is compact. Memory addresses and debugging: a crash log full of 0x7ffee3b0 values is just hex pointers.

Converting without a calculator app

For quick conversions, every operating system calculator has a “programmer” mode that toggles between decimal, hex and binary instantly. In a browser console, (255).toString(16) gives "ff" and parseInt("ff", 16) gives 255. Learning to eyeball the common ones — 0x10 = 16, 0xFF = 255, 0x100 = 256 — is enough for most day-to-day reading.

A conversion table worth memorising

You do not need to memorise all sixteen values, but the handful below cover most of what you will meet in colour codes, permissions and byte dumps. Four bits (a nibble) always map to exactly one hex digit, which is the whole reason the notation exists.

HexDecimalBinaryWhere you meet it
000000No colour channel, null byte
881000High bit of a nibble set
A101010First "letter" digit
F151111All four bits on
FF2551111 1111Maximum single byte

Reading a colour code properly

Take #FF5733. Split it into three pairs: FF, 57, 33. Those are the red, green and blue channels, each running 0–255. Red is FF, which is 255, so red is at full strength. Green is 57, which is 5×16 + 7 = 87. Blue is 33, which is 3×16 + 3 = 51. The result is a strong orange-red, and you can reason about it without opening a colour picker.

This also explains why #FFF works as shorthand for #FFFFFF: each digit is simply doubled. It is a notation convenience, not a different colour.

Mistakes that cost people time

The most common error is reading hex as if it were decimal. 0x20 is not twenty, it is 32, and that single misreading is behind a lot of confusion about ASCII tables, where 0x20 is the space character. A second frequent slip is forgetting that hex digits are case-insensitive: 0xff and 0xFF are the same value, though many codebases standardise on one for consistency.

A subtler trap appears with file sizes and memory addresses. A jump from 0x0FFF to 0x1000 looks small but crosses a 4,096-byte boundary, which is exactly one memory page on most systems. Boundaries that look arbitrary in decimal are often round numbers in hex, and that is usually the clue that you are looking at something the hardware cares about.

Common questions

Why do programmers use hexadecimal instead of decimal?

Because four binary digits map cleanly to one hex digit, hex is the shortest human-readable way to represent binary data like bytes, colors, and memory addresses.

What does the 0x prefix mean?

0x signals that the number that follows is written in hexadecimal, so 0x1F is hex, not the decimal number 1.

How many values fit in two hex digits?

Two hex digits (one byte) represent 0 to 255 — which is exactly why RGB color channels run from 00 to FF.

How do I convert hex to decimal quickly?

Use your OS calculator's programmer mode, or in a browser console run parseInt('ff', 16) to get 255.