Number Systems

Number Systems Explained: Binary, Hex, Roman Numerals, and Rounding

A number and the way you write it are two different things. The quantity we call one hundred and eighty-one is 181 in decimal, 10110101 in binary, B5 in hexadecimal, 265 in octal, and — if you squint at a film credit — CLXXXI in Roman numerals. Same amount, five spellings. This guide shows how each system encodes a value, how to convert between them by hand (every example here actually computes), and the two places where "just writing the number" quietly goes wrong: turning digits into words, and rounding. When you just need the answer, a free in-browser converter does it instantly — but once you can read the systems, you'll trust the answer and spot a bad one.

The one idea: a base and its place values

Every positional number system works the same way. Pick a base b; each position is worth b times the position to its right. In everyday decimal the base is 10, so 181 means:

(1 × 100) + (8 × 10) + (1 × 1) = 100 + 80 + 1 = 181

Change the base and only the place values change. In binary (base 2) the places are 1, 2, 4, 8, 16, 32, 64, 128… In hexadecimal (base 16) they are 1, 16, 256, 4096… Octal (base 8) uses 1, 8, 64, 512. The digits available also change: base 2 uses 0–1, base 8 uses 0–7, base 16 needs sixteen digits, so it borrows letters — 0–9 then A (=10), B (=11), C (=12), D (=13), E (=14), F (=15).

Here is the same first stretch of counting in the three systems computers care about:

Decimal Binary Hex
0 0000 0
1 0001 1
2 0010 2
5 0101 5
8 1000 8
10 1010 A
12 1100 C
15 1111 F
16 10000 10

Notice hex rolls over to 10 exactly when decimal reaches 16 — a reminder that 10 only means "ten" in base 10. In hex, 10 is sixteen.

Binary: base 2, the language underneath

Computers store everything as bits — 0s and 1s — so binary is the base the machine actually thinks in. To read a binary number, add up the place values wherever there's a 1.

Worked example — 10110101 to decimal. Line the bits up under their place values (highest on the left):

Bit 1 0 1 1 0 1 0 1
Value 128 64 32 16 8 4 2 1

Add the values with a 1 above them: 128 + 32 + 16 + 4 + 1 = 181.

Going the other way, decimal → binary, use repeated division by 2 and read the remainders bottom to top:

181 ÷ 2 = 90 r 1 · 90 ÷ 2 = 45 r 0 · 45 ÷ 2 = 22 r 1 · 22 ÷ 2 = 11 r 0 · 11 ÷ 2 = 5 r 1 · 5 ÷ 2 = 2 r 1 · 2 ÷ 2 = 1 r 0 · 1 ÷ 2 = 0 r 1

Reading the remainders from the last division up: 10110101. It matches — a good habit is to convert back to check.

An 8-bit binary number (one byte) spans 0 to 11111111 = 255, which is exactly why colour channels and many other computer values top out at 255. If that number rings a bell, it should: it's the same 0–255 byte behind hex, RGB, and HSL colour codes.

Hexadecimal: base 16, binary for humans

Hex earns its keep because one hex digit is exactly four bits (a "nibble"). Sixteen values, four bits — they line up perfectly, so converting between binary and hex is pure grouping, no arithmetic.

Worked example — 10110101 to hex. Split into nibbles from the right and translate each:

1011 0101 → 1011 = 8+2+1 = 11 = B, 0101 = 4+1 = 5 = 5B5

So 10110101 = 0xB5. Check it against decimal: B5 = (11 × 16) + 5 = 176 + 5 = 181. All three agree, which is the whole point — 181, 10110101, and B5 are one number in three costumes.

Reading longer hex is the same base-16 sum. 0x1F4 = (1 × 256) + (15 × 16) + 4 = 256 + 240 + 4 = 500. The 0x prefix (and CSS's #) is just a flag that says "the following digits are hex" — without it, 500 and 1F4 look like different numbers because they are written in different bases.

Octal (base 8) survives mainly in Unix file permissions, where chmod 755 packs three permission bits per digit. For the record, 181 in octal is 265, since (2 × 64) + (6 × 8) + 5 = 128 + 48 + 5 = 181 — the same value once more, base 8 this time.

Roman numerals: a system with no place value

Roman numerals are the odd one out: not positional, and no zero. Seven letters carry fixed values that you mostly add up left to right.

Symbol I V X L C D M
Value 1 5 10 50 100 500 1000

The one twist is the subtractive rule: when a smaller symbol sits directly before a larger one, you subtract it. That gives the six legal subtractive pairs — IV (4), IX (9), XL (40), XC (90), CD (400), CM (900) — and nothing else. You never write IIII for 4 on a clockface's logic, and you never stack more than three of a symbol in a row.

Worked example — 1994. Break it into thousands, hundreds, tens, units and spell each with the nearest legal chunk:

1994 = 1000 + 900 + 90 + 4 = M + CM + XC + IV = MCMXCIV

Read it back to check: M (1000) + CM (900) + XC (90) + IV (4) = 1994. A simpler modern one: 2024 = MMXXIV (1000 + 1000 + 10 + 10 + 4). The practical ceiling for standard Roman numerals is 3999 = MMMCMXCIX; there's no symbol for larger thousands and no zero at all, which is exactly why the system lost to positional decimal for arithmetic and survives only for decoration — clock faces, chapter numbers, movie copyright years, monarch and Super Bowl numbering.

Numbers into words: the cheque-writing conversion

Turning 1234 into "one thousand, two hundred thirty-four" is a conversion too, and it has one real gotcha: where "and" goes. US style omits it in the whole-number part — one thousand two hundred thirty-four. British style inserts "and" before the last group under a hundred — one thousand two hundred and thirty-four. On a cheque, the "and" convention is reserved for the decimal/pence part, which is why "and 00/100" appears at the end.

Two rules keep spelled-out numbers correct:

  • Group in threes and name the group. 1,204,050 reads as "one million, two hundred four thousand, fifty" — each comma-group gets its scale word (million, thousand) except the last.
  • Hyphenate the compound tens. Twenty-one through ninety-nine take a hyphen: forty-two, ninety-nine. Round numbers and the hundreds don't: forty, two hundred.

This is the one number "conversion" a machine still helps with most, because the edge cases (zero, teens, exact hundreds, the "and") are fiddly to get right by hand every time.

Rounding: where two correct methods disagree

Rounding looks trivial until two people round the same number and get different answers — legitimately. The split is over the exact halfway case, like 2.5.

  • Round half up (what most people learn): 0.5 always goes up. 2.5 → 3, 3.5 → 4. Simple, but it nudges a long column of data slightly upward, because halves always climb.
  • Round half to even, also called banker's rounding: a halfway value goes to the nearest even digit. 2.5 → 2, 3.5 → 4. Over many values the ups and downs cancel, so sums stay unbiased — which is why spreadsheets, many programming languages, and financial systems default to it.

Worked example. Round 0.125 to two decimal places. The dropped digit is a lone 5, so it's a true halfway case. Round-half-up gives 0.13; banker's rounding looks at the digit it's keeping (the 2, which is even) and stays at 0.12. Neither is "wrong" — they're different, documented rules, and a result is only reproducible if everyone uses the same one.

There's a second rounding trap that has nothing to do with method: computers can't store some decimals exactly. In binary floating point, 0.1 + 0.2 comes out as 0.30000000000000004, not 0.3, because 0.1 has no exact binary representation — the same base-conversion idea from the top of this guide, biting back. That's why money is often handled in whole cents (integers) rather than fractional dollars, and why a good tool tells you which rounding rule and how many places it used.

Finally, don't confuse decimal places with significant figures. Rounding 0.004987 to two decimal places gives 0.00 (useless); to two significant figures it gives 0.0050 — the sig-fig version keeps the two digits that actually carry information. Reference values in a table should hold a consistent number of sig figs so they stay comparable, a habit that also matters across ordinary unit conversions.

A quick sanity checklist

Before trusting any base or rounding conversion:

  1. Which base is this? A leading 0x means hex, 0b means binary, 0o means octal; a bare 10 is ambiguous until you know.
  2. Convert back to check. Decimal → binary → decimal should return your start; if it doesn't, you dropped a bit.
  3. Count your digits. One hex digit = 4 bits = up to 15; two hex digits = one byte = up to 255.
  4. Roman numeral legal? No symbol four times in a row, only the six subtractive pairs, nothing above 3999.
  5. Which rounding rule? Half-up and banker's rounding disagree on exact halves — state which one and round only at the end.

FAQ

How do I convert binary to decimal by hand?

Write the place values (1, 2, 4, 8, 16, … doubling leftward) under each bit, then add the values wherever there's a 1. 10110101 → 128 + 32 + 16 + 4 + 1 = 181. To go back, divide by 2 repeatedly and read the remainders bottom to top.

Why is hexadecimal used instead of binary?

Because one hex digit maps to exactly four bits, so hex writes the same bit pattern in a quarter of the characters with no arithmetic — 10110101 becomes just B5. It's binary made readable, which is why colours, memory addresses, and byte values are shown in hex.

What is the largest Roman numeral?

In the standard system, 3999 = MMMCMXCIX. There's no symbol for four thousand and no zero, so anything larger needs non-standard notation (like a bar over a numeral to multiply it by 1000). This ceiling is a big reason Roman numerals never worked for real calculation.

Why does 0.1 + 0.2 not equal 0.3 on a computer?

Because 0.1 and 0.2 have no exact representation in binary floating point, the way 1/3 has none in decimal. The stored values are a hair off, so the sum prints as 0.30000000000000004. It's a base-conversion artefact, not a bug — handle money in whole cents to avoid it.

What's the difference between round half up and banker's rounding?

They only disagree on exact halves. Round half up always sends 0.5 upward (2.5 → 3); banker's rounding (round half to even) sends it to the nearest even digit (2.5 → 2, 3.5 → 4), which keeps large sums unbiased. Most spreadsheets and financial systems use banker's rounding by default.


Need to convert a number between systems right now? Medley Web is building a free hub of instant, in-browser tools — binary ⇄ decimal ⇄ hex, Roman numerals, number-to-words, and rounding among them — one input in, many formats out. Convert numbers between systems free at medley-web.com.

Comments are disabled for this article.