Convert any decimal number to binary with step-by-step division method
Try an example:
Tip: The division method works by repeatedly dividing by 2 and reading the remainders from bottom to top. The last remainder is the most significant bit.
Converting decimal to binary using the division-by-2 method is the standard approach taught in every computer science program. The idea is simple: keep dividing the decimal number by 2, writing down the remainder at each step, until you reach 0. Then read the remainders from bottom to top — that's your binary number.
Take 42 as an example. 42 / 2 = 21 remainder 0. 21 / 2 = 10 remainder 1. 10 / 2 = 5 remainder 0. 5 / 2 = 2 remainder 1. 2 / 2 = 1 remainder 0. 1 / 2 = 0 remainder 1. Reading the remainders upward: 101010. That's 42 in binary. I've done this exact conversion so many times that I can now recognize 101010 as 42 on sight — it's one of those numbers that shows up a lot in demo code and tutorials, probably because "The Answer to the Ultimate Question of Life, the Universe, and Everything" makes it memorable.
For example, 13: 13 / 2 = 6 r1, 6 / 2 = 3 r0, 3 / 2 = 1 r1, 1 / 2 = 0 r1 → Read upward: 1101.
01101000100001000000011111111 — Maximum 8-bit number.10000000000 — 1 kilobyte in binary.You might think that in 2026 nobody needs to manually convert decimal to binary anymore. And sure, high-level programming languages handle all of this for you. But there's a difference between not needing to do something and understanding how it works. When you understand binary representation, concepts like two's complement for negative numbers, bitwise operations, and integer overflow become intuitive rather than mysterious.
I once spent three hours debugging a hard-to-find bug in an embedded system because a sensor returned a status byte and I was interpreting the bits wrong. The documentation said "bit 7 indicates error" — but I was reading it as the leftmost bit of a 4-bit field when it was actually the MSB of the full byte. The moment I sat down and manually converted the decimal sensor reading to binary, the mistake was obvious. A good decimal to binary converter would have caught it in seconds. That's why I built this — sometimes seeing the raw bits is the fastest debugger there is.