Turn a decimal number into binary and watch it happen by repeated division by two, with the answer also shown in octal and hex.
Your files are processed in your browser, on your own device. Nothing is uploaded to a server.
This decimal to binary converter turns a whole decimal number into binary and shows the division working that built it. Your number is divided by two again and again, each quotient and remainder printed in a row, and the remainders are then read from the bottom up to form the binary answer at the top.
Type the decimal number, read the binary answer, then walk the divisions.
Dividing by two peels a number apart from its smallest bit. Every division asks one question: is there a 1 left over? The remainder answers it, bit by bit, starting with the rightmost bit of the final answer.
Watch 13 become binary. Thirteen divided by two gives 6, remainder 1. Six gives 3, remainder 0. Three gives 1, remainder 1. One gives 0, remainder 1. Now read the remainders from the bottom up: 1101. That bottom-up read is the part everyone trips on, which is why the rows are printed in order and the answer sits above them.
Bigger anchors behave the same way. Nineteen comes out as 10011, and 255 fills a whole byte as 11111111. Since 255 is the largest value eight bits can hold, it is a handy memory check: if your eight-bit answer beats it, something went wrong earlier.
Grouped output spaces the bits in fours, the way programmers read them, because a run of twenty bits is hard to count with the naked eye. The same value also shows in octal and hex under the answer for quick cross-checks.
Long numbers stay exact here. Ordinary calculator maths loses track of whole numbers beyond 2 to the power of 53, which quietly corrupts big conversions. This converter works in arbitrary precision, so the division rows stay honest for numbers of any size you are likely to type.
Typing is checked as strictly as the maths. A letter or stray symbol in the input is pointed out by name and position, not swallowed. If you paste a number still wearing a prefix like 0x from a block of code, the prefix comes off and the page says so.
Signs are kept simple and labelled. A negative decimal converts by its size, and the minus sign rides along as sign and magnitude. The tool does not dress the answer up as two’s complement, because that is a fixed-width storage format, and pretending a plain answer is one would mislead anyone comparing against a textbook.
Fractions are out of scope, openly. If the input has digits after a point, the whole part converts and the rest is flagged on screen rather than dropped in silence. A tool that hides its limits teaches bad habits.
All of it happens in your browser. Nothing is uploaded or stored, no account is needed, and there is no limit on conversions.
Keep dividing the number by two, writing down each remainder, until the quotient reaches zero. Then read the remainders from the last one to the first. For 13, the remainders are 1, 0, 1, 1 in the order you get them, and they read back as 1101.
Because the first division finds the smallest bit, the one that belongs on the right. Each later remainder belongs one place further left, so the answer assembles in reverse order.
11111111. It is the largest value a single byte can hold, with all eight bits set to 1.
Yes. It uses arbitrary precision maths rather than ordinary floating point, so long numbers convert digit for digit instead of rounding once they pass the usual 53-bit exactness limit.
The size of the number converts as normal and the minus sign is carried and labelled as sign and magnitude. Two’s complement output is not offered, since that format depends on a chosen bit width.
No, and it says so on screen. The whole part converts, the fraction is flagged, and nothing is silently discarded.
Same rules as this one: free, in your browser, with nothing uploaded.
Exact age in years, months and days for any form.
Marks, discounts and change, worked out properly.
Body mass index from height and weight, with its range.
Monthly loan payment, total interest and full cost.
The final price after a discount, and what you saved.
Add or remove GST at the rate your invoice uses.
Add tax to a price or pull it back out.
Work out a tip and split a bill between people.