Binary ↔ Decimal ↔ Hex Converter
Convert numbers between binary, octal, decimal and hexadecimal at once.
Related Tools
0 comments
How it works
Pick the base of the number you type — binary (2), octal (8), decimal (10), or hexadecimal (16). The value is parsed with BigInt so even numbers beyond 2^53 stay exact, then re-rendered in all four bases using toString(radix). Input is validated against the active base: only 0-1 for binary, 0-7 for octal, 0-9 for decimal, and 0-9 a-f for hex. Everything is computed locally in your browser with no rounding loss.
(255).toString(2) === "11111111"
(255).toString(16) === "ff"
Common use cases
- Reading a hex color or memory address as plain decimal.
- Converting binary flags or bitmasks to hex for compact storage.
- Checking a permission value like 0o755 across octal, decimal, and binary.
Frequently asked questions
Does it handle very large numbers?
Yes. Parsing uses BigInt, so values far above the normal JavaScript safe-integer limit (2^53) convert without losing precision — useful for 64-bit identifiers and long bitmasks.
Can it convert negative numbers?
It converts the magnitude and preserves a leading minus sign. Two's-complement representations of negatives are not produced, since those depend on a fixed bit width you would need to specify.
What about fractional values?
This tool converts whole numbers (integers) between bases. Fractional binary or hex conversion is a separate problem and is not supported here.