Counting in different bases
Decimal feels natural only because we learn it first. A number base (or radix) is simply a choice of how many digit symbols to use before carrying into the next place: decimal uses ten digits (0–9), binary uses two (0–1), octal uses eight (0–7) and hexadecimal uses sixteen (0–9 then A–F for ten to fifteen). The value of a number does not change when its base changes — 255, 11111111, 377 and FF are four spellings of exactly the same quantity — only the spelling changes. This converter translates between all four bases and shows the working, not just the answer.
How positional notation works
In decimal, 255 means 2 × 102 + 5 × 101 + 5 × 100 = 200 + 50 + 5. The same rule in any base explains every conversion here: binary 11111111 means 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, and hexadecimal FF means 15 × 16 + 15 = 255. To convert from any base, expand in powers of that base as in the step-by-step panel. To convert a decimal number to binary, repeatedly divide by 2 and read the remainders backwards — the detail section shows that division table for your value.
Why computers use binary, octal and hex
Computer circuits have two stable states, so binary is their native language — but long binary strings are unreadable for humans. Octal and hexadecimal are compression formats for binary: each octal digit stands for exactly three binary digits, and each hex digit for exactly four, so converting between them is just regrouping, with no arithmetic. That is why memory addresses, colour codes such as #FF5733, file permissions and network settings are written in hex. A byte is eight binary digits, which is exactly two hex digits, running from 00 to FF (0 to 255) — the default example on this page.
Digits must be smaller than the base
The one input rule: every digit must be less than the base. Binary cannot contain a 2, octal cannot contain an 8 or 9, and decimal cannot contain the letter A. If you enter a digit that is not allowed in the source base you selected, this converter says so plainly instead of silently guessing — a surprisingly common source of wrong answers in other tools, where an input like 102 in binary mode might be misread as decimal. Hexadecimal input is case-insensitive, so ff, FF and Ff are identical.
Worked example
Decimal 42 converts as follows: binary 101010 (32 + 8 + 2), octal 52 (5 × 8 + 2), hexadecimal 2A (2 × 16 + 10, where A means ten).
How to use this calculator
- Type the number exactly as it is written in its original base.
- Select that source base — decimal, binary, octal or hexadecimal.
- Read the decimal value in the green panel and all four bases in the breakdown table.
- For a decimal input, study the repeated-division table below; for other bases, follow the positional expansion.
- If you get an invalid-digit message, check each digit is smaller than the source base.
Quick mental conversions worth memorising
A few anchors make base work much faster. Powers of two double each step — 1, 2, 4, 8, 16, 32, 64, 128, 256 — and a binary number is just a shopping list of those powers. F in hex is 15, 10 in hex is 16 (not ten), and 100 in hex is 256. In the other direction, decimal 10 is A in hex and 1010 in binary. Programmers also meet base 2 prefixes (0b), base 8 (0o) and base 16 (0x) in code, which are labels, not part of the number. For longer expressions involving powers and roots across bases, convert to decimal first with this tool, then use the Scientific Calculator.