Guide
Writing decimal numbers in binary with repeated division
Anyone who has written a number in binary by hand has used the same trick: keep halving it and note what is left over. This page performs that routine instantly and prints each step, so it works as a calculator when you are in a hurry and as a worked solution when you are learning the method.
The division method
Divide the number by 2. Write down the remainder, which is always 0 or 1, and divide the quotient by 2 again. Stop when the quotient reaches 0. The remainders, read from the last one to the first one, are the bits of the answer. The reason it works is that each division peels off the lowest bit: an even number ends in 0, an odd one in 1, and halving the number shifts everything one place to the right.
Fractions are done the other way round
The part after the decimal point is multiplied by 2 instead. Each time the result passes 1, that step’s digit is 1 and the 1 is removed; otherwise the digit is 0. Take 0.625: doubling gives 1.25 (digit 1), then 0.5 (digit 0), then 1.0 (digit 1), so the fraction is .101. When the doubling never lands on exactly zero, the binary expansion is infinite. Decimal 0.1 is such a case, and the page prints 0.000110011001100110011001… with an ellipsis after 24 digits.
Options
“Add 0b prefix” puts the marker that many languages use in front of the result, and “Group digits” splits long answers into readable blocks. Neither alters the number. You can paste a list of numbers, one per line, and every line is converted. If one line is invalid, it gets its own message with the position of the bad character and the rest still convert.
Negative numbers
A minus sign stays in front of the binary digits: −13 is shown as −1101. That is sign-and-magnitude written in text, not how a processor stores the value. If you need the 8-, 16- or 32-bit pattern for −13, the two’s complement calculator gives it, including the range of values that fit the chosen width.
A worked example
The Sample button loads 2026. The divisions run 2026 → 1013 → 506 → 253 → 126 → 63 → 31 → 15 → 7 → 3 → 1 → 0 with remainders 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1. Read from the bottom up they spell 11111101010, an 11-bit number. The “other bases” box confirms it with 3752 in octal and 7EA in hexadecimal, and you can verify the binary by adding 1024 + 512 + 256 + 128 + 64 + 32 + 8 + 2, which is 2026.
Limits
Results are exact for whole numbers of any size, but binary fractions can only match decimal ones that are sums of powers of one half. The cut-off after 24 digits is a display decision, not an error margin you can rely on in calculations. The page does not choose a bit width for you; leading zeros are dropped, so a byte value such as 5 is shown as 101 and you must pad it yourself when a format wants eight digits.
Related tools
- Binary to Decimal reverses the conversion with a place-value table.
- Decimal to Hex uses the same repeated-division idea with 16 as the divisor.
- IEEE 754 Converter shows how fractions such as 0.1 are actually stored in a float.
- Text to Binary converts characters rather than numbers.
Checked against the current version of the Decimal to Binary on .

