Decimal to Binary Converter

→
Binary = repeatedly divide by 2, keep each remainder, read the remainders upwards

Decimal to binary: writing a number the way a machine stores it

What this conversion does

It rewrites a base 10 number using only 0 and 1. Every integer has exactly one binary form, and no information is lost in either direction, so the conversion is a relabelling rather than an approximation. That is why the tool can promise an exact answer for a number with thirty digits, which a floating-point calculator cannot.

Why the remainders are read backwards

The division method produces the least significant bit first, so the digits must be read from the bottom of the list to the top. Reading them in the order they were written is the single most common mistake in hand conversion, and it turns 156 into 00111001 instead of the correct 10011100. Each remainder is genuinely a digit of the answer: the number of division steps is exactly the bit length of the result.

Decimal to binary conversion table

The small decimal numbers that appear most often in programming, with their binary forms. The powers of two are the ones worth memorising — the rest follow from them.

DecimalBinary
00
11
7111
81000
101010
151111
1610000
3111111
641000000
1001100100
1271111111
20011001000
25511111111
10001111101000

Where you meet binary without noticing

Every file permission, network mask, feature flag register and image channel is a binary number wearing a friendlier notation. Reading 156 as 10011100 tells you immediately that the high bit and four middle bits are set, which is the question you actually have when a status register looks wrong. Hexadecimal exists to make that same reading shorter, but it is still the bits underneath.

Counting on your fingers, accurately

If you need a quick answer, subtract the largest power of two that fits and repeat: 156 − 128 = 28, 28 − 16 = 12, 12 − 8 = 4, 4 − 4 = 0, giving 128 + 16 + 8 + 4 = 10011100. This works because binary is the only base where the digit is either fully present or absent.

Frequently asked questions

How do I convert a decimal number to binary by hand?

Divide by 2 and write down the remainder, then divide the quotient by 2 and repeat until the quotient is zero. The remainders, read from last to first, are the binary number. For 156 that gives remainders 0, 0, 1, 1, 1, 0, 0, 1, which read backwards are 10011100.

How many binary digits does a decimal number need?

One bit for every time you can halve it, which is the base 2 logarithm rounded up. A number up to 255 needs 8 bits, up to 65535 needs 16, and up to about 4.3 billion needs 32. The tool shows the exact length rather than padding to a fixed width.

Can this converter handle numbers larger than a calculator?

Yes. Most calculators switch to floating-point and start rounding past 2 to the power of 53, but this one works in exact integer arithmetic, so a 64-bit value comes back with every digit correct rather than an approximation that looks plausible.

How are negative numbers shown?

With a minus sign in front of the binary digits — a sign-and-magnitude form. Two's complement is a different convention that only has meaning once you fix a bit width, so it is not used here. If you need a 32-bit two's complement representation of a negative number, say so explicitly in your own code.

Does the converter accept fractions?

Yes, and it handles them honestly. The whole part converts exactly; the fractional part is expanded digit by digit and stops as soon as it reaches zero. A fraction such as one tenth never terminates in binary, so the result is truncated and the page says so rather than pretending the answer is complete.

Copy the code below and paste it into your website to add this converter.

<!-- Decimal to Binary -->
<iframe src="https://unitflow.net/embed/decimal-to-binary" title="Decimal to Binary" width="100%" height="420" loading="lazy" style="border:0;max-width:100%;display:block"></iframe>
<p><a href="https://unitflow.net/decimal-to-binary" target="_blank" rel="noopener">Powered by UnitFlow</a></p>