Skip to content

Converters

Number Base Converter

Convert between binary, octal, decimal, hex and base 36 with exact precision for 64-bit values. Shows bit length and the smallest integer type that fits.

Runs on your device — nothing is uploaded

Convert a number between binary, octal, decimal, hexadecimal and base 36. Type in any row and the others update instantly.

Precision that actually holds

This converter uses arbitrary-precision integers, so 64-bit values convert exactly. That matters more than it sounds: JavaScript's ordinary numbers lose precision above 2^53, which silently corrupts anything larger — database IDs, snowflake IDs, bitmasks, hashes. Many online converters have this bug. This one does not.

How to use this tool

  1. Type into whichever row matches what you have.
  2. Every other row updates as you type.
  3. Copy any row with the button beside it.

Prefixes (0x, 0b, 0o), spaces, and underscores are stripped automatically, so you can paste 0xDE_AD_BE_EF straight in.

What the summary shows

  • Bit length — how many binary digits the value needs
  • Bytes needed — bit length rounded up to whole bytes
  • Fits in — the smallest unsigned integer type that can hold it (uint8 through uint64)

Quick reference

| Decimal | Binary | Hex | |---|---|---| | 8 | 1000 | 8 | | 16 | 10000 | 10 | | 64 | 1000000 | 40 | | 255 | 11111111 | FF | | 256 | 100000000 | 100 | | 1024 | 10000000000 | 400 | | 65535 | 1111111111111111 | FFFF |

Two hex digits map exactly to one byte, which is why hex is the standard way to write raw bytes, colours, and memory addresses.

Related tools

FAQ

Is anything sent to a server?

No. Conversion runs locally using BigInt arithmetic.

Can it handle negative numbers?

Yes, with a leading minus sign. Two's-complement representations of negative numbers are a separate concept and are not shown.

Does it support decimals or fractions?

No — integers only. Fractional binary conversion involves floating-point representation, which is a different problem.

Why does 0.1 + 0.2 not equal 0.3 in binary?

Because 0.1 has no exact finite binary representation, in the same way 1/3 has no exact finite decimal one. That is a floating-point issue rather than a base-conversion one.

What is base 36?

Digits 0–9 followed by letters a–z. It packs a number into the shortest possible alphanumeric string, which is why it turns up in URL shorteners and short IDs.

More converters

Try these next