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.

Last updated: October 2026

Your data stays in your browser.

Bit length:
Binary result —
Recent

No recent conversions yet.

How to convert decimal to binary

  1. Divide the decimal number by 2 and write down the remainder (0 or 1).
  2. Divide the quotient by 2 and write down the new remainder.
  3. 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

DecimalBinaryCalculation
000
111
2102
3112+1
41004
51014+1
61104+2
71114+2+1
810008
910018+1
1010108+2
1110118+2+1
1211008+4
1311018+4+1
1411108+4+2
1511118+4+2+1

Powers of 2

PowerValue
201
212
224
238
2416
2532
2664
27128
28256
29512
2101024
2112048
2124096
2138192
21416384
21532768
21665536

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

Common mistakes

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>