Binary, decimal, hex and octal converter
Type a number, pick its base, and see it in binary, octal, decimal and hexadecimal at once, with the working shown. Everything runs in your browser.
Working
How number bases work
A base tells you how many digits a number system uses. Decimal uses ten digits (0 to 9). Binary uses two (0 and 1), octal uses eight (0 to 7), and hexadecimal uses sixteen (0 to 9 and A to F).
Each place in a number is worth a power of the base. In binary, 1011 means 1×8 + 0×4 + 1×2 + 1×1 = 11.
Convert decimal to binary by hand
Divide the number by 2 again and again and write down each remainder. Read the remainders from last to first. For 13: 13÷2 = 6 r 1, 6÷2 = 3 r 0, 3÷2 = 1 r 1, 1÷2 = 0 r 1. Reading upwards gives 1101.
Quick tips for hex
One hex digit is exactly four binary digits, so you can convert in groups of four bits. For example, binary 1111 0101 is hex F5. Hex is popular because it is a short way to write long binary values such as colours (#FF8800) and memory addresses.
Common values
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 255 | 11111111 | 377 | FF |
More free tools: truth table generator · CS MCQs · Big-O cheat sheet