Number bases explained: binary, octal, decimal, and hex
A number base is just how many symbols you count with before rolling over to the next digit. We use base 10 by habit; computers think in base 2; and programmers lean on base 16 because it bridges the two cleanly.
What a base means
In base 10, each position is a power of ten: 425 = 4×100 + 2×10 + 5×1. Change the base and you change the multiplier. The same value 13 is 1101 in binary, 15 in octal, and D in hex. Convert any value in the Number Base Converter.
Binary (base 2)
Binary uses only 0 and 1, mirroring a circuit being off or on. It is how computers store everything — but it is verbose for humans: one byte is eight binary digits like 11010010.
Hexadecimal (base 16) — the programmer’s favorite
Hex uses digits 0-9 then A-F for 10–15. Its superpower: one hex digit maps exactly to four binary digits, so two hex digits represent one byte. That is why you see hex in color codes (#FF3D68), memory addresses, and byte dumps.
binary: 1101 0010
hex: D 2 -> 0xD2 -> 210Octal (base 8)
Octal uses 0-7 and groups bits in threes. It is mostly a relic today, surviving in Unix file permissions (chmod 755), where each digit encodes three permission bits.
Frequently asked questions
- Why do programmers use hexadecimal instead of binary?
- One hex digit equals exactly four binary digits, so hex is a compact, readable shorthand for binary. Two hex digits represent one byte, which is why hex appears in colors, addresses, and byte dumps.
- How do I convert binary to decimal?
- Add the place values where there is a 1: each position is a power of two. 1101 = 8 + 4 + 0 + 1 = 13. A converter does it instantly.
- Where is octal still used?
- Mainly Unix file permissions (chmod 755), where each octal digit encodes three permission bits for owner, group, and others.
- What does the 0x prefix mean?
- It marks a number as hexadecimal in most programming languages, e.g. 0xFF is 255. Binary often uses 0b and octal 0o.
Try it yourself
Put this guide into practice — these tools run free in your browser.