How decimal to binary conversion works
To convert a base-10 number to base-2, divide it by 2 over and over, keeping each remainder. Reading the remainders from last to first gives the binary digits. For 10: 10÷2=5 r0, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1 → 1010. Each remainder is one bit, with the most significant bit produced last.
There is a faster route for numbers you meet often: subtract the largest power of two that fits, mark a 1, and repeat. For 200: 128 fits (1), remainder 72; 64 fits (1), remainder 8; then 8 fits, giving 11001000. The powers to keep in mind are 1, 2, 4, 8, 16, 32, 64, 128.
Many people follow this up with the hex to decimal calculator.
How to use this calculator
Enter a whole decimal number of 0 or more and read the binary result. To convert the other way, use the binary to decimal calculator.
The conversion runs entirely in your browser, so nothing you type is uploaded or stored. The output has no leading zeros - decimal 5 returns 101, not 00000101. Pad it yourself to 8 or 16 digits when you need a fixed-width byte.
The text to binary converter handles the same job in a slightly different way.
Decimal to binary reference table
Common conversions:
| Decimal | Binary |
|---|---|
| 1 | 1 |
| 2 | 10 |
| 5 | 101 |
| 10 | 1010 |
| 16 | 10000 |
| 255 | 11111111 |
For base-16 output, see the decimal to hex calculator.
Notice the pattern in the table: every power of two is a 1 followed by zeros, and every value one below a power of two is a run of 1s. That makes binary a quick way to check bit-mask logic - a permission flag set at 4 is 100, so it never collides with flags at 1 or 2.
Frequently asked questions
- What is 10 in binary?
- Decimal 10 is 1010 in binary: 8 + 2 = 10.
- How do I convert decimal to binary by hand?
- Divide by 2 repeatedly, write down each remainder, then read the remainders from bottom to top.
- What is 255 in binary?
- 11111111 — eight 1s, the maximum value of a single 8-bit byte.
- Does this handle decimals or negatives?
- It converts whole numbers of 0 or more. Fractions are rounded down and negatives are not supported here.
- How many bits will my number need?
- Count how many times you can halve it before reaching zero. Values up to 255 fit in 8 bits, up to 65,535 in 16 bits, and up to 4,294,967,295 in 32 bits - which is why those three limits appear so often in software.