- Home
- Tools
- Math
- Number Base Converter
- Decimal to Binary Converter
Decimal to Binary Converter
Type a decimal number and get it in binary, with the divisions by two that lead to each bit written out.
Type a decimal number in the first field and read it in binary in the second. It works the other way round as well. Whole numbers only; spaces, underscores and the prefixes 0b, 0o and 0x are fine.
Working
| Division | Result | 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 |
The remainders from the last to the first: 10011100
Other bases
- Bit length
- 8 bits
- Fits in
- 1 byte
How to convert decimal to binary by hand
Divide the number by 2 and write down the remainder, which is 0 or 1. Divide the result by 2 again, and keep going until nothing is left.
The remainders are the binary digits in reverse order: the first remainder is the right-hand digit. For 156 the remainders are 0, 0, 1, 1, 1, 0, 0 and 1. Read from the last to the first they give 10011100.
The other way is to take away powers of two. Find the largest one that fits, write a 1 for it, and carry on with what is left. 156 = 128 + 16 + 8 + 4, so there is a 1 in the places for 128, 16, 8 and 4 and a 0 everywhere else.
The working under the two fields at the top of the page does this for whatever number you type.
Good to know
- The first remainder already tells you something: odd numbers end in 1, even numbers in 0.
- A number below 256 fits in eight bits. Computers show it with zeros in front to fill the byte, so 5 appears as 00000101. That is the same number as 101.
- Fractions are not converted here. Most decimal fractions, 0.1 among them, have no finite binary form.
Decimal to binary table
| Decimal | Binary |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 10 |
| 3 | 11 |
| 4 | 100 |
| 5 | 101 |
| 6 | 110 |
| 7 | 111 |
| 8 | 1000 |
| 9 | 1001 |
| 10 | 1010 |
| 11 | 1011 |
| 12 | 1100 |
| 13 | 1101 |
| 14 | 1110 |
| 15 | 1111 |
| 16 | 1 0000 |
| Decimal | Binary |
|---|---|
| 20 | 1 0100 |
| 32 | 10 0000 |
| 50 | 11 0010 |
| 64 | 100 0000 |
| 100 | 110 0100 |
| 127 | 111 1111 |
| 128 | 1000 0000 |
| 200 | 1100 1000 |
| 255 | 1111 1111 |
| 256 | 1 0000 0000 |
| 500 | 1 1111 0100 |
| 512 | 10 0000 0000 |
| 1000 | 11 1110 1000 |
| 1024 | 100 0000 0000 |
| 4096 | 1 0000 0000 0000 |
| 65535 | 1111 1111 1111 1111 |
The number base converter shows binary, octal, decimal and hexadecimal next to each other, and explains positional notation and two's complement.