How to convert decimal to binary
- Type a whole number in decimal.
- The binary form appears, split into groups of four bits so it is easy to read, with the number of bits and bytes needed.
The division method
Divide the number by 2 and write down the remainder (0 or 1). Keep dividing the quotient by 2 until it reaches 0. The binary number is the remainders read from bottom to top. For 156: 156 ÷ 2 = 78 r0, 78 ÷ 2 = 39 r0, 39 ÷ 2 = 19 r1, 19 ÷ 2 = 9 r1, 9 ÷ 2 = 4 r1, 4 ÷ 2 = 2 r0, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading upwards gives 10011100.
Alternatively, subtract the largest power of two that fits (128), then the next (16), and so on, writing 1 for each power used: 156 = 128 + 16 + 8 + 4 → 1001 1100.
| Decimal | Binary |
|---|---|
| 1 | 1 |
| 2 | 10 |
| 5 | 101 |
| 10 | 1010 |
| 16 | 1 0000 |
| 42 | 10 1010 |
| 100 | 110 0100 |
| 127 | 111 1111 |
| 255 | 1111 1111 |
| 1000 | 11 1110 1000 |
Each group of four bits is one hexadecimal digit, which is why 1001 1100 is 9C in hex. Large numbers are handled exactly.
FAQ
What is 10 in binary?
1010.
How many bits do I need for a number?
The tool shows it under the binary result. In general, n bits hold values up to 2ⁿ − 1.
How do I write a negative number in binary?
Mathematically with a minus sign. Computers use two’s complement: invert the bits of the positive value and add 1, at a fixed width such as 8 or 32 bits.