Number System Converter
Convert between binary, octal, decimal, hexadecimal and any base from 2 to 36, with a step-by-step solution showing the division and place-value working.
How to convert decimal to binary (division method)
Divide the number by 2, write down the remainder, and keep dividing the quotient by 2 until it reaches 0. The remainders read from bottom to top are the binary number.
Example: convert 156 to binary
| Division | Quotient | Remainder |
|---|---|---|
| 156 รท 2 | 78 | 0 |
| 78 รท 2 | 39 | 0 |
| 39 รท 2 | 19 | 1 |
| 19 รท 2 | 9 | 1 |
| 9 รท 2 | 4 | 1 |
| 4 รท 2 | 2 | 0 |
| 2 รท 2 | 1 | 0 |
| 1 รท 2 | 0 | 1 |
Reading the remainders upward gives 156 = 10011100โ. The same method works for any base: divide by 8 for octal, 16 for hexadecimal, or any base from 2 to 36. The Show the working panel in the converter above builds this table for whatever number you type.
How to convert binary to decimal
Each digit is worth its value times the base raised to its position, counting from 0 on the right. Multiply and add:
= 128 + 16 + 8 + 4 = 156
How to convert decimal to hexadecimal
Use the division method with 16. Remainders from 10 to 15 are written as the letters A to F. Example: 2024
- 2024 รท 16 = 126, remainder 8
- 126 รท 16 = 7, remainder 14 (E)
- 7 รท 16 = 0, remainder 7
Read upward: 2024 = 7E8โโ. To go back, multiply by powers of 16: 7ร256 + 14ร16 + 8 = 2024.
Shortcut: binary to hex and octal
Because 16 = 2โด and 8 = 2ยณ, you can skip decimal entirely. Split the binary number into groups of 4 bits for hex or 3 bits for octal, starting from the right, and convert each group on its own:
010 011 100โ โ 2 3 4 โ 234โ
This is why programmers use hex: every byte (8 bits) is exactly two hex digits.
Number systems compared: 0 to 16
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 3 | 11 | 3 | 3 |
| 4 | 100 | 4 | 4 |
| 5 | 101 | 5 | 5 |
| 6 | 110 | 6 | 6 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
Where you'll see each number system
- Binary (base 2): how computers store everything. See text as binary with the binary translator.
- Octal (base 8): Unix file permissions such as 755 and 644. The chmod calculator builds them for you.
- Hexadecimal (base 16): web colors like #1E90FF, memory addresses and character codes. Try the color converter or the ASCII table.
- Base 36: short IDs and URL shorteners, since it uses all digits and letters.