Decimal to Binary Converter

Share converter:
Embed this tool:

Enter a decimal number and its binary form appears as you type. The guide below walks through the division method so you can verify the answer yourself.

How decimals become binary

Decimal is base 10 and binary is base 2. Converting between them means rewriting the same quantity using only the digits 0 and 1, where each position is worth a power of two (1, 2, 4, 8, 16 and so on) instead of a power of ten.

Every whole number has exactly one binary form. For example, 13 is 8 + 4 + 1, so it is written 1101: a 1 in the 8s, 4s and 1s positions and a 0 in the 2s position.

How to convert decimal to binary

The standard method for whole numbers is repeated division by 2. Divide the number by 2, note the remainder (always 0 or 1), then divide the quotient by 2 again. Stop when the quotient reaches 0. The remainders, read from last to first, are the binary digits.

Example: convert 45. 45 ÷ 2 = 22 remainder 1; 22 ÷ 2 = 11 remainder 0; 11 ÷ 2 = 5 remainder 1; 5 ÷ 2 = 2 remainder 1; 2 ÷ 2 = 1 remainder 0; 1 ÷ 2 = 0 remainder 1. Reading the remainders from the bottom up gives 101101.

Another example: 156 gives remainders 0, 0, 1, 1, 1, 0, 0, 1 from first to last, so reading backwards the result is 10011100.

For the fractional part of a number, multiply by 2 instead and collect the whole-number parts. Take 0.625: 0.625 × 2 = 1.25 gives a 1; 0.25 × 2 = 0.5 gives a 0; 0.5 × 2 = 1.0 gives a 1 and leaves nothing. So 0.625 is 0.101 in binary.

What the converter shows

  • Negative numbers get a minus sign in front of the binary form of their magnitude, so −5 becomes −101. This is not two's complement.
  • Fractions are expanded digit by digit. 0.5 is 0.1 and 3.75 is 11.11, because those values are sums of powers of two.
  • Most other decimals never end in binary. 0.1 repeats forever in base 2, so the converter prints the 55-digit binary value of the double-precision number closest to 0.1 rather than 0.1 exactly.
  • Large numbers show the bits of the nearest double-precision value. Integers above 9007199254740991 (2^53 − 1) can lose their lowest bits, which then appear as trailing zeros.
  • An empty box counts as 0.

Decimal to binary conversion table

DecimalBinary
00
11
210
311
4100
5101
6110
7111
81000
91001
101010
111011
121100
131101
141110
151111
1610000
32100000
50110010
641000000
1001100100
1271111111
12810000000
25511111111
256100000000
10001111101000
102410000000000

Check your work in the opposite direction with the binary to decimal converter. For a more compact notation, convert to base 16 with the decimal to hex converter, or do arithmetic on binary numbers with the binary calculator.

Frequently asked questions

How do I convert 10 to binary?

Divide by 2 repeatedly: 10 ÷ 2 = 5 remainder 0, 5 ÷ 2 = 2 remainder 1, 2 ÷ 2 = 1 remainder 0, 1 ÷ 2 = 0 remainder 1. Reading the remainders backwards gives 1010.

Why is 0.1 such a long binary number?

0.1 cannot be written as a finite sum of powers of two, so its binary expansion repeats forever. The tool shows the closest value a double-precision number can hold, which runs to 55 digits after the point.

Does the tool give two's complement for negative numbers?

No. It writes a minus sign followed by the binary digits of the absolute value. Two's complement needs a fixed bit width, which this converter does not use.

How many bits does a number need?

A positive whole number n needs the floor of log base 2 of n, plus 1, bits. For instance 255 needs 8 bits and 256 needs 9.

References

  1. Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems)

Cite this converter and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). Decimal to Binary Converter. Reeliy. https://reeliy.com/converters/convert-decimal-to-binary“Decimal to Binary Converter.” Reeliy, 2026, https://reeliy.com/converters/convert-decimal-to-binary.