Binary converter
Convert an integer between binary, octal, decimal and hex. BigInt keeps it exact far past the usual 53-bit limit, and the All bases panel shows every base at once.
Input
Decimal → Binary
ConvertedType a base-10 value to convert it.
- Bases
- 2 · 8 · 10 · 16
- Precision
- Exact
Related tools
This binary converter turns whole numbers from one base into another: binary (base 2), octal (8), decimal (10) or hexadecimal (16). Pick a From base and a To base, type a value, and the result appears as you type. The math runs on BigInt from start to finish, so even a 256-bit value converts without a digit going wrong. It all happens in your browser.
How to use the binary converter
- Under From, choose the base you're typing in.
- Under To, choose the base you want.
- Type the number. The 0b, 0o and 0x prefixes are optional, and spaces or underscores are ignored.
- Open All bases to see the value in all four bases, and click any of them to copy it.
Why BigInt matters for base conversion
Regular JavaScript numbers are 64-bit floats, and they stop counting exactly above 2^53, about 9 quadrillion. Past that, a converter built on them quietly rounds digits away. This one uses BigInt throughout, so a 64-character SHA-256 digest or a 128-bit IPv6 address converts exactly. Input is capped at 100,000 digits.
Frequently asked questions
What bases does the binary converter support?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16), in any direction.
How do I convert decimal to binary?
Set From to Decimal and To to Binary, then type your number. 255 becomes 11111111.
Can it convert negative numbers or fractions?
Negative integers, yes: the minus sign carries over, so -10 in decimal is -1010 in binary. It doesn't use two's complement. Fractions and decimal points aren't supported.
Does the converter handle large numbers accurately?
Yes. BigInt stores integers exactly at any size, so there's no floating-point rounding. The only limit is 100,000 digits of input.
Built and maintained by Bipul Kumar. Found a wrong number or a broken result? Tell me and I'll fix it.