Decimal to binary converter
Any decimal number to binary, exactly — plus hex and octal.
| Binary | 11111111 | |
| Octal | 377 | |
| Decimal | 255 | |
| Hexadecimal | ff |
Convert decimal numbers to binary
Type a decimal number and get its binary form, plus hexadecimal and octal. Large values stay exact thanks to BigInt, so 264 or a 30-digit ID converts digit-for-digit rather than being rounded.
Doing it by hand: repeated division
Divide by 2, write down the remainder, and repeat with the quotient until it reaches 0. The remainders read from last to first are the binary number. For 45:
- 45 ÷ 2 = 22 remainder 1
- 22 ÷ 2 = 11 remainder 0
- 11 ÷ 2 = 5 remainder 1
- 5 ÷ 2 = 2 remainder 1
- 2 ÷ 2 = 1 remainder 0
- 1 ÷ 2 = 0 remainder 1
Reading upwards gives 101101. Negative numbers are shown with a minus sign; two's complement only makes sense for a fixed width such as 8 or 32 bits, which a general converter can't assume.
Other conversions with this tool
How to convert decimal to binary
- 1
Type a decimal number.
- 2
Read the binary value in the table.
- 3
Copy any result with one click.
Decimal to Binary — frequently asked questions
How do you convert decimal to binary by hand?
Divide by 2 repeatedly and write down the remainders, then read them from last to first. 13 → 6 r1 → 3 r0 → 1 r1 → 0 r1 gives 1101.
How are negative numbers shown?
With a minus sign in front of the binary magnitude (−5 → -101). Two's complement depends on a fixed bit width, which plain number conversion doesn't have.
Does it handle numbers bigger than 2^53?
Yes. It uses BigInt, so large integers are converted exactly rather than rounded like ordinary JavaScript numbers.