Free forever · No sign-up
Decimal to Binary Converter
Convert any decimal number to binary instantly — pick a bit length, see every division step. Free, fast, no sign-up.
Enter a whole number (digits only).
Out of range for the selected bit width.
Your data stays in your browser.
Step-by-step
| Division | Quotient | Remainder |
|---|
Read the remainders bottom → top.
No recent conversions yet.
Also equals
- Binary
- Decimal
- Octal
- Hex
How to convert decimal to binary
- Divide the decimal number by 2 and write down the remainder (0 or 1).
- Divide the quotient by 2 and write down the new remainder.
- Repeat until the quotient is 0, then read the remainders from bottom to top.
Example: 13 → 13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → 1101.
Background reading: the binary number system on Wikipedia.
Quick reference table
| Decimal | Binary | Calculation |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 10 | 2 |
| 3 | 11 | 2+1 |
| 4 | 100 | 4 |
| 5 | 101 | 4+1 |
| 6 | 110 | 4+2 |
| 7 | 111 | 4+2+1 |
| 8 | 1000 | 8 |
| 9 | 1001 | 8+1 |
| 10 | 1010 | 8+2 |
| 11 | 1011 | 8+2+1 |
| 12 | 1100 | 8+4 |
| 13 | 1101 | 8+4+1 |
| 14 | 1110 | 8+4+2 |
| 15 | 1111 | 8+4+2+1 |
Powers of 2
| Power | Value |
|---|---|
| 20 | 1 |
| 21 | 2 |
| 22 | 4 |
| 23 | 8 |
| 24 | 16 |
| 25 | 32 |
| 26 | 64 |
| 27 | 128 |
| 28 | 256 |
| 29 | 512 |
| 210 | 1024 |
| 211 | 2048 |
| 212 | 4096 |
| 213 | 8192 |
| 214 | 16384 |
| 215 | 32768 |
| 216 | 65536 |
Decimal to binary in code
Python
bin(10)[2:] # → '1010'
JavaScript
(10).toString(2); // → '1010'
C
#include <stdio.h>
int main(void) {
int n = 10;
char buf[33];
int i = 0;
if (n == 0) buf[i++] = '0';
while (n > 0) { buf[i++] = '0' + (n % 2); n /= 2; }
buf[i] = '\0';
for (int j = i - 1; j >= 0; j--) putchar(buf[j]); /* → 1010 */
putchar('\n');
return 0;
}
Real-world applications
- Setting Unix file permissions with chmod, where 7 = 111 grants read, write and execute.
- Building bitmasks and feature flags in code.
- Deriving subnet masks from CIDR notation in networking.
- Teaching place value and powers of two in computer science classes.
Common mistakes
- Reading the remainders top-to-bottom — they must be read bottom-to-top.
- Stopping the divisions too early — keep going until the quotient reaches 0.
- Dropping leading zeros when a fixed width like 8-bit is required — 5 is 101, but 8-bit is 00000101.
Common values
- 10 =
1010₂ - 255 =
11111111₂ (eight 1s) - 16 =
10000₂ - 100 =
1100100₂ - 0 =
0₂ - 1,024 =
10000000000₂
Key takeaways
- Divide by 2 repeatedly and read the remainders bottom-to-top.
- Or subtract the largest fitting power of two and repeat with the remainder.
- Pad with leading zeros to reach 8, 16 or 32 bits when a fixed width is needed.
- 0 in decimal is 0 in binary — no special case needed.
- Large numbers convert exactly the same way; the converter handles any length.
Frequently asked questions
How do I convert decimal to binary?
Repeatedly divide by 2, record each remainder, and read the remainders bottom-to-top. The converter above shows every step.
What is 10 in binary?
10 in decimal equals 1010 in binary.
How do I convert decimal to 8-bit binary?
Convert as normal, then pad with leading zeros to 8 digits — e.g. 10 becomes 00001010. Use the bit-length selector above.
What is 100 in binary?
100 in decimal equals 1100100 in binary.
What is the fastest way to convert decimal to binary by hand?
For small numbers, subtract the largest power of two that fits, mark a 1, and repeat with the remainder. For anything else, use the converter above.
What is 255 in binary?
255 = 11111111 — eight 1s, the largest value one byte can hold.
How do I add leading zeros to make 8-bit binary?
Convert normally, then pad on the left with zeros to 8 digits — for example 10 becomes 00001010. The bit-length selector above does this for you.
Can I convert negative decimals to binary?
Yes — negative numbers use two’s complement. On the binary to decimal page, tick ‘Signed (two’s complement)’ and pick a bit width; for example, −1 in 8-bit is 11111111.
Need the reverse? Try our binary to decimal converter.
More converters
Add this converter to your website
Embed our free binary to decimal converter on your own site with one line of code:
<script src="https://binary-to-decimal-28z.pages.dev/embed.js"></script>