Skip to content
Devtoolry

Decimal to Binary Converter

Convert decimal numbers to binary online and see the division by 2 step by step. Supports fractions, 8, 16, 32 and 64-bit two's complement and bulk lists.

Runs in your browser · Nothing uploaded · No sign-up

Something not working, or missing a feature? Send feedback

About the Decimal to Binary Converter

The Decimal to Binary Converter writes any decimal number in base 2 and shows the classic method: divide by 2 again and again and read the remainders from the bottom up. Choose an 8, 16, 32 or 64-bit width to pad the result or to see negative numbers in two's complement, as a CPU stores them.

Conversion happens in your browser, so your files and records stay private.

How to use the Decimal to Binary Converter

  1. Type a decimal number such as 156, or paste a list with one number per line.
  2. Pick a bit width if you need padding or two's complement for negative numbers; leave Auto otherwise.
  3. Read the binary result and the division table that produced it.
  4. Turn on "Group by 4 bits" for easier reading, then copy the result.

Decimal 0–16 in binary

DecimalBinary8-bit
0000000000
1100000001
21000000010
31100000011
410000000100
510100000101
611000000110
711100000111
8100000001000
9100100001001
10101000001010
11101100001011
12110000001100
13110100001101
14111000001110
15111100001111
161000000010000

Examples

A whole number

Input

156

Result

10011100

156 ÷ 2 = 78 r0, 78 ÷ 2 = 39 r0, 39 → r1, 19 → r1, 9 → r1, 4 → r0, 2 → r0, 1 → r1; read upwards.

A negative number in 8 bits

Input

-5 (Bit width 8-bit)

Result

11111011
A fraction that repeats

Input

0.1

Result

0.00011001100110011001100110011001…

The … marks a fraction cut off after 32 binary digits.

Grouped for reading

Input

1000 (Group by 4 bits)

Result

11 1110 1000

Common mistakes

  • Reading the remainders top-down. The first remainder is the lowest bit. Reading the division table from the top gives the bits in reverse.
  • Expecting exact decimal fractions. Most decimal fractions repeat in binary. Store money in whole cents (integers) instead of binary floating point.

Works well with the Decimal to Binary Converter

Frequently asked questions

How do you convert decimal to binary?

Divide the number by 2 and write down the remainder (0 or 1). Repeat with the quotient until it is 0. The remainders read from the last to the first are the binary digits: 156 gives 10011100.

How are negative numbers written in binary?

Computers use two's complement. For −5 in 8 bits, take 2⁸ − 5 = 251, which is 11111011. Pick a bit width so the converter knows how many bits to use; with Auto it writes −101 with a minus sign.

Why does 0.1 never end in binary?

0.1 is 1/10, and 10 has the factor 5, which powers of 2 cannot divide. The digits repeat forever (0.000110011…), so the converter stops after 32 digits and marks the result with …. This is also why 0.1 + 0.2 is not exactly 0.3 in floating point.

What range fits in each width?

8 bits hold 0 to 255 unsigned or −128 to 127 signed; 16 bits 0 to 65,535 or −32,768 to 32,767; 32 bits up to 4,294,967,295 or −2,147,483,648 to 2,147,483,647. The converter tells you when a value does not fit.