Guides

Octal, Hex and Decimal: Who Actually Uses Each

Ask a calculator to show a number without telling it a base and you get decimal, because we were raised on ten fingers. But the machines beneath are not decimal at all, and the systems humans built to talk about them are weirdly picky about which base they tolerate. Decimal, binary, octal and hex are not interchangeable flavors — each holds one narrow, specific job.

Decimal: the display layer

Decimal wins whenever the consumer is a human being making a human decision. Prices, ages, port numbers, measurement — anything you would read aloud. Its weakness is that it disconnects from the machine. A decimal like 255 gives no clue it is the largest byte, and carries no clean relationship to binary. It is comfortable and structurally useless.

Binary: the truth

The chip only knows presence and absence of voltage, so binary is the one ground truth. Every other base is a re-encoding of binary. You touch it directly when you set a bitmask, read a raw register, or inspect a network packet. It is exact but four to five times longer than hex, and human eyes misread long runs of 1s and 0s.

Hex: the byte's shorthand

Hex is binary's compact alias because 16 = 24. Four bits collapse into one digit, two digits capture a full byte, and the mapping never drops a bit. That perfect byte alignment is why hex owns the modern stack: CSS colors (#FF6A00), MAC addresses, IPv.6 parsing, memory addresses printed in debuggers, and every crypto hash ever rendered (SHA-256, 0x prefixes everywhere).

Octal: the survivor no one loves

Octal is base 8, a relic of the era before bytes were fixed at 8 bits. When a word was 12 or 24 bits, dividing by three fit perfectly and octal read more cheaply than binary. Those machines are gone, but octal clings on in three places:

Octal never aligned with the 8-bit byte (8 is not divisible by 3), which is why hex — aligned at 2 digits per byte — displaced it. It survives by habit, not by merit.

The alignment cheat-sheet

Hex is the only base that pairs evenly with 8-bit bytes. That single fact explains the whole war: hex won because the machine standardized on octets.

When the mental math breaks

Handling 0x2F to a bitmask, or a 0755 that suddenly reads as 493 minus the leading zero in your head — the prefixes and the arithmetic drift. That is exactly when a converter stops being a crutch and becomes the verify step: type the value once, read all four bases together, and let the machine guarantee what your mental math was about to get wrong.