Decimal to Binary Converter
Type in either box — the other updates live. For decimal input, the full divide-by-2 working is printed underneath.
The Divide-by-2 Method, Step by Step
Every decimal-to-binary converter is doing one of two things under the hood, and the honest one is the method you can check with a pencil: divide by 2, keep the remainders. Each division answers one question — is there a bit in this place? — starting from the lowest place (the 1s) and working up. The remainders are the binary digits, in reverse order of how you found them.
Watch it happen with 42:
| Step | Division | Quotient | Remainder (bit) |
|---|---|---|---|
| 1 | 42 ÷ 2 | 21 | 0 |
| 2 | 21 ÷ 2 | 10 | 1 |
| 3 | 10 ÷ 2 | 5 | 0 |
| 4 | 5 ÷ 2 | 2 | 1 |
| 5 | 2 ÷ 2 | 1 | 0 |
| 6 | 1 ÷ 2 | 0 | 1 |
Reading the remainder column from the bottom up: 101010. The converter above prints this exact table for any number you type (up to 1,048,576), so a homework answer can be checked step by step rather than trusted blindly.
Checking Your Answer with Place Values
The other direction is the check: binary place values double from the right — 1, 2, 4, 8, 16, 32, 64… For 101010, the 1 bits are under 32, 8 and 2, and 32 + 8 + 2 = 42. If your converted value doesn't add back up to the number you started with, a digit went missing.
Need the neighbouring conversions too? The shelf has binary to hex (group the bits in fours), hex to decimal, and the all-in-one Binary Converter with octal as well. Turning text into binary instead? That's the Text to Binary Converter.
Frequently Asked Questions
How do you convert a decimal number to binary?
Divide the number by 2 and write down the remainder. Divide the result by 2 again, and keep going until you reach 0. The remainders, read from last to first, are the binary digits. For 42: 42÷2 = 21 r0, 21÷2 = 10 r1, 10÷2 = 5 r0, 5÷2 = 2 r1, 2÷2 = 1 r0, 1÷2 = 0 r1 — reading the remainders upwards gives 101010.
What is 42 in binary?
42 in binary is 101010. You can check it by place value: 101010 has bits in the 32s, 8s and 2s places, and 32 + 8 + 2 = 42.
What is 255 in binary?
255 in binary is 11111111 — eight 1 bits in a row. That is no coincidence: 255 is the largest value one byte (8 bits) can hold, because 2^8 − 1 = 255. It is also why 255 turns up everywhere in computing, from colour channels to IP addresses.
How do you convert binary back to decimal?
Multiply each bit by its place value and add. Places double from the right: 1, 2, 4, 8, 16, 32… For 101010 the 1 bits sit at 32, 8 and 2, so the decimal value is 32 + 8 + 2 = 42. Type a binary number into the second box above and the decimal value appears as you type.
Why does the division method read the remainders upwards?
The first division tells you the value of the lowest bit (the 1s place) — whether the number is odd or even. Each further division peels off the next higher bit. So the first remainder you write down is the rightmost digit of the answer, and the last remainder is the leftmost digit: the digits arrive in reverse order and are read bottom-up.
How many bits do I need for a number?
A number n needs enough bits that 2^bits is greater than n: the count is floor(log2(n)) + 1 for n ≥ 1. 42 needs 6 bits (101010), 255 needs 8, 1,000 needs 10 (1111101000) and 1,000,000 needs 20. Zero is the special case — it is just 0, a single digit.
Does this converter work for very large numbers?
Yes. It converts using exact integer arithmetic (BigInt), not floating point, so large values such as 123456789 convert digit-for-digit exactly: 111010110111100110100010101. The written-out division steps are shown for numbers up to 1,048,576; above that the page still converts instantly but skips the long steps table.
Is this decimal to binary converter free?
Yes. It is completely free with no signup required, and it runs entirely in your browser — the numbers you enter are never uploaded or stored.