Binary / Hex Converter

Convert any non-negative integer between binary, octal, decimal, and hexadecimal. Paste a value, pick its base, and see all four conversions at once. Arbitrary precision — works on 256-bit hex strings without losing digits.

Input base

Non-negative integers only. Spaces, underscores, and the matching prefix (0x / 0b / 0o) are ignored.

Binary grouping

Prefixes

Try

Quick reference

Allowed digits

  • Binary (base 2) — 0, 1
  • Octal (base 8) — 0–7
  • Decimal (base 10) — 0–9
  • Hex (base 16) — 0–9, A–F

Common values

  • 255 = 0xFF = 0b11111111
  • 1024 = 0x400 = 2¹⁰
  • 65535 = 0xFFFF = 2¹⁶ − 1
  • 0o755 = 493 (Unix file mode)
Frequently asked questions

Can I paste a value with a 0x, 0b, or 0o prefix?

Yes. Set the matching input base and the tool strips the prefix automatically. Spaces and underscores in your input are also ignored, so grouped values like 1010_1010 work fine.

Does it lose precision on very large numbers?

No. Conversions use arbitrary-precision arithmetic (BigInt), so even a full 256-bit hex string converts to binary, octal, and decimal without rounding or dropping digits.

Can it convert negative numbers or decimals?

No. This converter accepts non-negative integers only — fractions, decimal points, and minus signs are rejected as invalid input.

Example: what is 255 in every base?

Entering 255 as decimal gives binary 0b1111 1111, octal 0o377, and hex 0xFF — all four shown side by side with your chosen grouping and prefix.

Related tools