One value, four number systems
We count in decimal, with ten digits from 0 to 9. Computers work in binary, with only 0 and 1. Programmers write colours, memory addresses and byte values in hexadecimal, and Unix file permissions use octal. This number base converter shows the same whole number in all four systems at once, so you can switch between them without doing the maths by hand.
How to use it
- Type a whole number into Input.
- Choose its input base: binary (2), octal (8), decimal (10) or hexadecimal (16).
- Read the number in binary, octal, decimal and hexadecimal.
For hexadecimal, the letters A to F stand for the values 10 to 15. Upper and lower case both work.
How positional systems work
In every base, each position is worth the base raised to a power. In decimal, 345 means 3 × 100 + 4 × 10 + 5 × 1. In binary, 1011 means 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11. In hexadecimal, 2F means 2 × 16 + 15 = 47.
Useful values
- 255 = 11111111 (binary) = 377 (octal) = FF (hex), the largest value of one byte
- 16 = 10000 (binary) = 20 (octal) = 10 (hex)
- 1,024 = 10000000000 (binary) = 400 (hex)
- 65,535 = FFFF (hex), the largest 16-bit value
Where you need this
- Web design: the colour #FF8800 consists of the hex values FF, 88 and 00, which are 255, 136 and 0 in decimal RGB.
- Programming: bit masks, flags and byte values are easier to read in binary or hex.
- Networking: subnet masks like 255.255.255.0 are long runs of binary ones.
- Linux: the file permission 755 is octal for rwxr-xr-x.
- School and university: converting between number systems is part of computer science courses.
Frequently asked questions
Can I convert decimals?
No. This converter handles whole numbers only. For fractions, use the fraction calculator.
Why does hexadecimal use letters?
Base 16 needs sixteen digits. After 0 to 9, the letters A to F stand for 10 to 15.
Why do programmers like hex?
One hex digit represents exactly four bits, so a byte is always two hex digits. That makes binary data much easier to read.
Is my data stored or sent anywhere?
No. The calculation runs entirely in your browser. Nothing you enter is saved, tracked or sent to a server.