Skip to main content
Premier SEO Services

Binary converters

Decimal to Binary Converter

Convert a decimal number to binary and see the repeated division by two that produces it. Works for large integers, negative numbers in two's complement and decimal fractions.

  • Runs in your browser
  • Free, no sign-up
  • Unlimited use
  • Updated 30 September 2026

Decimal to Binary Converter

Paste your text — the result updates as you type

How to use the decimal to binary converter

  1. 1Type the number in Decimal (base 10). Commas between thousands are ignored.
  2. 2Read the result in Binary (base 2). Tick Group digits to split it into groups of four.
  3. 3Keep Show steps ticked to see each division by 2 and its remainder.
  4. 4For a negative number as a computer stores it, choose Two's complement under Negative numbers and set the Bit width.

Example

Input
156
Output
Binary: 10011100
Hexadecimal: 9C
Octal: 234

156 ÷ 2 = 78 r0, 78 ÷ 2 = 39 r0, 39 ÷ 2 = 19 r1, 19 ÷ 2 = 9 r1, 9 ÷ 2 = 4 r1, 4 ÷ 2 = 2 r0, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading the remainders from the bottom up gives 10011100.

Division-by-two method

Divide the number by 2, write down the remainder (0 or 1), and repeat with the quotient until it reaches 0. The binary number is the remainders read from the last to the first.

DivisionQuotientRemainder
10 ÷ 250
5 ÷ 221
2 ÷ 210
1 ÷ 201

Reading upwards: 10 = 1010. A faster mental method for small numbers is to subtract the largest power of two that fits (10 − 8 = 2, 2 − 2 = 0, so bits 8 and 2 are set).

Large numbers

The converter uses arbitrary-precision integers, so values beyond 2⁵³ (9,007,199,254,740,992), where JavaScript and spreadsheets start rounding, still convert exactly. A number needs ⌊log₂ n⌋ + 1 bits: 255 needs 8, 256 needs 9, and one million needs 20. The helper text under the binary field shows the bit count.

Negative numbers

There are two ways to write −10 in binary:

  • Minus sign: -1010. Fine on paper, but computers don't store a separate sign symbol.
  • Two's complement: write 10 in the chosen width (00001010), flip every bit (11110101) and add 1: 11110110. This is how processors store signed integers.

The width matters: −10 is 11110110 in 8 bits and 1111111111110110 in 16 bits. If a number does not fit (for example −200 in 8 bits, whose range is −128 to 127), the tool says so instead of wrapping around.

Decimal fractions to binary

For the part after the point, multiply by 2 and take the whole-number part as the next bit, then repeat with what is left:

0.625 × 2 = 1.25 → 1, 0.25 × 2 = 0.5 → 0, 0.5 × 2 = 1 → 1, so 0.625 = 0.101.

Most decimal fractions never finish in binary. 0.1 becomes 0.0001100110011… forever, which is why 0.1 + 0.2 isn't exactly 0.3 in most programming languages. The converter stops after 32 binary places and tells you the result was cut off.

Quick reference: 0-255

DecimalBinaryDecimalBinary
001610000
1132100000
210641000000
3111001100100
41001271111111
510112810000000
8100020011001000
10101025511111111

Is my text private?

This tool runs entirely in your browser. Your text is not uploaded to our servers.

Sources

Questions about the decimal to binary converter

What is 10 in binary?

  1. Ten is 8 + 2, so the bits worth 8 and 2 are 1 and the others are 0.

How do I convert a decimal fraction to binary?

Convert the whole part by dividing by 2, then convert the fraction by repeatedly multiplying by 2 and collecting the whole-number digits. 5.75 becomes 101.11.

How many bits does a number need?

Find the smallest power of two greater than the number; its exponent is the bit count. 100 is below 128 (2⁷), so it needs 7 bits. In two's complement, add one bit for the sign.

Last updated 30 September 2026Maintained by Premier SEO Services

Report a problem