Number Systems In Computing

By Rick Oosterling · Published on January 28, 2026

Decimal, binary and hexadecimal are often taught as abstract computer science topics, but they matter because modern devices constantly switch between them behind the scenes. A user may never hand-write binary, yet still deal with bit depth, memory addresses, color values or debugging output that makes more sense once the numbering system is understood. The IEEE (Institute of Electrical and Electronics Engineers) defines standard conventions for these systems across computing platforms worldwide. This guide stays in one lane: it explains the four bases programmers meet daily (binary base 2, octal base 8, decimal base 10, hexadecimal base 16), how they map onto each other, and why hex earns its place. Storage capacity math (KB versus KiB) lives in the storage and data units guide linked below, so this page keeps its focus on the bases themselves.

Decimal is for people, binary is for machines

Decimal is easy for human counting because we group naturally in tens. Binary is practical for digital systems because electronic states are easy to represent as on or off. That basic contrast explains why the two systems coexist so comfortably in computing.

The confusion starts when users see binary-derived concepts without the surrounding explanation.

Why hexadecimal keeps appearing

Hex is simply a compact human-readable way to represent binary values. It is easier to scan and shorter to write. That is why it appears in memory work, web colors and low-level settings.

If binary is too long and decimal hides structure, hex often provides the practical middle ground.

Where normal users encounter this without realizing it

File permissions, color codes, MAC addresses, storage sizing discussions and firmware tools all expose traces of these number systems. Even people who never intend to code can benefit from a basic grasp because it makes technical labels less mysterious.

That understanding reduces the intimidation factor when troubleshooting or reading documentation.

How much you actually need to know

For most users, the goal is recognition, not mastery. Know that decimal is everyday counting, binary is base two, and hexadecimal compresses binary cleanly into a shorter form. That alone explains a surprising amount of modern computing language.

You do not need to become a mathematician to benefit from that clarity.

The takeaway

Number systems in computing matter because they explain why technical information is presented the way it is. Once you understand the role of each system, many labels stop feeling random.

That makes tools, guides and error messages much easier to read.

A worked example: the number 255

The number 255 makes this concrete. In decimal it is straightforward. In binary it is 11111111, eight bits all set, because 2^8 minus 1 equals 255. In hexadecimal it is FF, the two largest single hex digits side by side. All three represent the same value. When you see #FF0000 in CSS, the first FF is 255 red, 00 is green, 00 is blue.

DecimalBinaryHexContext
00000 000000Off, null, black channel
160001 000010First two-digit hex value
2551111 1111FFMax byte value, max color channel
2561 0000 0000100First value needing 9 bits or 3 hex digits

The pattern in that table is the whole reason hex exists in programming: 255 needs three digits in decimal but only two in hex, and the binary version is eight characters long. Hex carries the same information as binary in a quarter of the width.

Why hex maps onto binary so cleanly

One hexadecimal digit covers exactly four bits, because 2 to the power of 4 equals 16, and 16 is the hex base. That clean ratio is what decimal lacks: decimal does not line up with any whole number of bits, so converting decimal to binary needs real division, while converting hex to binary is a lookup. Octal works the same way at three bits per digit, which is why old Unix permission codes like 755 are written in octal.

BaseBits per digitValues per digitDigits to write one byte
Binary (base 2)128
Octal (base 8)383 (covers 9 bits, so one bit spare)
Decimal (base 10)no whole bit count103 (000 to 255)
Hexadecimal (base 16)4162

Only binary, octal and hex have a fixed bits-per-digit count, and hex packs the most bits into each character. That is why a 32 bit memory address fits in 8 hex digits but takes 32 binary digits to write out: 32 / 4 = 8.

Useful tools for this topic

Frequently Asked Questions

Why does FF equal 255 in hexadecimal?

Hex is base 16, so the left digit is a count of sixteens and the right digit is a count of ones. F is the hex symbol for 15, so FF means 15 × 16 plus 15, which is 240 plus 15 = 255. That is also the largest value a single byte holds, because a byte has 8 bits and 2 to the power of 8 gives 256 patterns numbered 0 to 255.

Why do web colours use hexadecimal instead of plain numbers?

A colour like #FF8800 packs three values into six characters: FF is the red channel, 88 is green, 00 is blue. Each channel is one byte with 256 levels (0 to 255), and two hex digits map onto exactly one byte. That gives 256 × 256 × 256 = 16,777,216 possible colours, the familiar 16.7 million figure, written in a compact form that decimal cannot match without commas and spaces.

How many bits are in a byte, and why does that number matter?

A byte is 8 bits. Those 8 bits give 2 to the power of 8 = 256 distinct states, which is why byte values run 0 to 255 and why one byte writes as exactly two hex digits (4 bits each). The 8 bit byte is the unit almost everything in computing is measured against, from a single ASCII character to one channel of an RGB colour.

What is the difference between octal and hexadecimal?

Octal is base 8 with one digit per 3 bits, so its digits run 0 to 7. Hex is base 16 with one digit per 4 bits, so its digits run 0 to F. Hex packs more into each character, which is why memory and colour work uses hex, while octal survives mainly in Unix file permissions: the code 755 reads as three 3 bit groups, 111 101 101, meaning read-write-execute for the owner and read-execute for everyone else.