Number Base Converter
Convert a number between binary, octal, decimal and hex — exactly, at any size.
System verdict
RESULT255 = 255 (decimal)
The same value in each base. A prefix on the input (0x, 0b, 0o) sets the base automatically; otherwise the selected base is used. Large values are exact — no precision is lost.
- Binary
- 0b11111111
- Octal
- 0o377
- Decimal
- 255
- Hexadecimal
- 0xFF
What this cannot tell you
- Whole numbers only. Fractional and negative values are not converted.
- A 0x, 0b or 0o prefix sets the base automatically and overrides the selector.
How this calculation works
Enter a number and the tool shows it in all four bases at once. If you prefix it — 0x for hex, 0b for binary, 0o for octal — the base is detected automatically. Conversions use arbitrary-precision integers, so even 64-bit values stay exact.
What the results mean
- Hexadecimal
- Base 16, using 0–9 and A–F. Compact for bytes — one hex digit is four bits, two make a byte.
- Binary
- Base 2. What the machine actually uses; long but unambiguous.
Frequently asked questions
Will large numbers lose precision?
No. The converter uses arbitrary-precision integers, so a full 64-bit value like a bitmask or a large ID converts exactly. A naive JavaScript converter loses precision past about 9 quadrillion (2^53); this one does not.
Can I convert negative numbers or decimals?
Not currently — this handles non-negative whole numbers. Negative values in binary depend on a chosen width and two’s-complement convention, which is a separate concern.