Decimal to Binary Converter
Convert decimal numbers to binary. Writing a decimal number in binary shows which bits are set, which is needed for bit masks, subnet masks and low-level programming.
Decimal to Binary converter
Result
- Binary
- —
- Octal
- —
- Decimal
- —
- Hexadecimal
- —
How to convert decimal to binary
Divide the number by 2, write down the remainder, and repeat with the quotient until it reaches 0. Read the remainders from last to first to get the binary digits.
Example: 156 (decimal) 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 |
Remainders from last to first: 10011100. So 156 = 10011100 in binary.
Examples
- 10 (decimal) = 1010 (binary)
- 156 (decimal) = 10011100 (binary)
- 255 (decimal) = 11111111 (binary)
- 1000 (decimal) = 1111101000 (binary)
Decimal to Binary conversion table
| Decimal (base 10) | Binary (base 2) |
|---|---|
| 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 | 10000 |
| 20 | 10100 |
| 32 | 100000 |
| 50 | 110010 |
| 64 | 1000000 |
| 100 | 1100100 |
| 127 | 1111111 |
| 128 | 10000000 |
| 255 | 11111111 |
| 256 | 100000000 |
| 512 | 1000000000 |
| 1000 | 1111101000 |
| 1024 | 10000000000 |
The table lists the same whole numbers for every pair of bases.
Frequently asked questions
- What is 255 in binary?
- 255 in decimal is 11111111 in binary.
- How do I convert decimal to binary by hand?
- Divide the number by 2, write down the remainder, and repeat with the quotient until it reaches 0. Read the remainders from last to first to get the binary digits.
- What digits does decimal use?
- Decimal uses the digits 0 to 9. Decimal is the everyday number system for counting, money and measurement.
- What is binary used for?
- Computers store and process everything as binary digits (bits). Eight bits make one byte.