Enter a decimal number and get its binary (and hexadecimal) form, using exact big-integer arithmetic for very large values.
How to use the decimal to binary converter
- Type the decimal number.
- Copy the binary result.
Divide-by-two method
Divide the number by 2 repeatedly and write down the remainders, then read them from bottom to top. 42 → 21 r0 → 10 r1 → 5 r0 → 2 r1 → 1 r0 → 0 r1, so 42 = 101010.
Frequently asked questions
How many bits do I need?
A number n needs floor(log2 n) + 1 bits. 255 needs 8 bits; 256 needs 9.
Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested