How to use the Decimal to Binary Converter
Type a whole number in decimal. You get the binary value in groups of four bits, plus hex and octal.
How decimal to binary conversion works
Divide the number by 2 and write down the remainder, then keep dividing the quotient by 2 until it reaches 0. Read the remainders from last to first. For 45: 45 → 22 r1, 22 → 11 r0, 11 → 5 r1, 5 → 2 r1, 2 → 1 r0, 1 → 0 r1, so 45 is 101101.
A faster method with powers of two
Find the largest power of two that fits (32 for 45), subtract it and repeat with what is left: 13 uses 8, the remaining 5 uses 4 and the last 1 uses 1. Put a 1 under each power you used and a 0 under the others. Reading 32, 16, 8, 4, 2, 1 gives 1 0 1 1 0 1.
How it works
Divide repeatedly by 2 and read the remainders upward.
Examples
- 45
Binary: 10 1101 Hex: 2D Octal: 55
- 255
Binary: 1111 1111 Hex: FF Octal: 377
- 1024
Binary: 100 0000 0000 Hex: 400 Octal: 2000
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 |
| 32 | 10 0000 |
| 64 | 100 0000 |
| 100 | 110 0100 |
| 128 | 1000 0000 |
| 255 | 1111 1111 |
Limitations and assumptions
Runs entirely in your browser. Nothing you enter is uploaded.
Frequently asked questions
What is 255 in binary?
1111 1111. It is the largest number that fits in one byte of eight bits.
What is 10 in binary?
1010. Ten is 8 + 2, so the bits for 8 and 2 are set.
How many bits do I need for a number?
A number below 2ⁿ fits in n bits. Values up to 255 need 8 bits, up to 65,535 need 16 bits and up to 4,294,967,295 need 32 bits.
How do I convert binary back to decimal?
Use the binary to decimal converter, which adds up the place values of the 1 bits.