ToolSec

Number Base Converter

Convert between binary, octal, decimal and hexadecimal — with big-number support.

Updated: June 27, 2026

Convert binary, octal, decimal and hex

Enter a value in any base and instantly see it in binary, octal, decimal and hexadecimal. The converter uses arbitrary-precision arithmetic (BigInt), so it handles values far beyond a 64-bit integer without losing digits — useful for hashes, bitmasks and large identifiers. Everything runs locally in your browser.

The four common bases

  • Binary (base 2) — just 0 and 1; how computers store everything at the lowest level.
  • Octal (base 8) — digits 0–7; still seen in Unix file permissions (e.g. chmod 755).
  • Decimal (base 10) — the everyday human base.
  • Hexadecimal (base 16) — digits 0–9 and a–f; compact and maps neatly to bytes, so it's everywhere in programming: colors, memory addresses, MAC addresses and hashes.

Why hex and binary go together

One hex digit represents exactly four bits (a "nibble"), and two hex digits make one byte. That clean mapping is why hexadecimal is the preferred shorthand for binary data — 0xFF is far easier to read than 11111111. When you're working with byte-level data, converting between hex and binary is a constant need.

Common uses

  • Reading a hex color or memory address as decimal, or vice versa.
  • Working out Unix permission bits in octal.
  • Inspecting bitmasks and flags in binary.
  • Converting a large hex hash or ID to decimal.

Tips

You can paste values with a 0x, 0b or 0o prefix — the converter strips it automatically. If you're converting bytes to readable characters instead of numbers, use the hex ↔ text converter; for Base64, see the Base64 tool.

Frequently asked questions

How do I convert binary to decimal?

Select 'Binary' as the input base, enter the bits (e.g. 11111111), and the decimal value (255) appears alongside octal and hex. The conversion is exact even for very large values.

Why does one hex digit equal four binary digits?

Because 16 = 2^4. Each hex digit encodes exactly four bits, and two hex digits make a byte. That tidy mapping is why hex is the standard shorthand for binary data.

Can it handle very large numbers?

Yes. It uses BigInt arithmetic, so values far larger than 64 bits convert without rounding or loss of precision — handy for hashes and big identifiers.

Do prefixes like 0x work?

Yes. A leading 0x (hex), 0b (binary) or 0o (octal) prefix is stripped automatically, so you can paste values straight from code.

Developer tools

If you switch bases constantly, these keep it close at hand:

  • Programmer's calculator / IDE extension Convert and compute across bases inline while you code, with bitwise operations built in.
  • Hex editor Inspect and edit binary files byte by byte, viewing values in hex, decimal and binary side by side.

Learn more

Related tools