Free exact browser converter
Decimal to Binary Converter
Convert decimal integers to binary online without precision loss. Handle zero and large numbers, choose a 0b prefix, and reject invalid or fractional input.
Interactive tool
Convert Decimal to Binary
Ready
Choose a clear output representation.
Detailed conversion guide
How to Convert Decimal to Binary
Repeated division by 2 yields binary digits from the remainders, read in reverse order. Decimal 59 equals 32 + 16 + 8 + 2 + 1, so the bits at those positions give 111011.
The browser parses the entire decimal input as BigInt and uses base-2 formatting. It keeps integers above 2^53 − 1 exact. A 0b prefix is optional and does not change the binary value.
| Input | Output | Meaning |
|---|---|---|
0 | 0 | zero |
10 | 1010 | decimal 10 |
59 | 111011 | decimal 59 |
255 | 11111111 | decimal 255 |
Decimal to Binary with BigInt
The algorithm validates the representation before exact integer conversion, so malformed input never produces a plausible partial answer.
const digits = input.trim();
if (!/^[0-9]+$/.test(digits)) throw Error("Invalid decimal integer");
const bits = BigInt(digits).toString(2);Fractions, Signed Values, and Binary Width
This page converts unsigned integers. Values such as −1, 0.5, or 1e3 are rejected. Fractional binary expansion and signed two’s-complement encoding require different rules and are not inferred.
The output uses the minimal bit width, with zero written as 0. Input leading zeros do not request padding. Spaces and underscores join decimal digits rather than delimiting multiple numbers.
Related converters
Continue with exact representation converters
Choose the converter for the input and output formats you are working with.