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
- Type into whichever row matches what you have.
- Every other row updates as you type.
- 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
- Colour converter — hex colours specifically
- Unit converter — including KB vs KiB
- Hash generator — produces hex digests
- Base64 encoder & decoder — a different kind of base
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
- QR Code GeneratorCreate a free QR code for a link, Wi-Fi network, email or phone number. Custom colours, adjustable size, PNG and SVG download. No tracking, no expiry.
- Unit ConverterConvert length, weight, temperature, volume, data, speed and area between metric and imperial units. Instant, accurate and free.
- Unix Timestamp ConverterConvert Unix timestamps to human-readable dates and back. Detects seconds vs milliseconds automatically and shows ISO 8601, UTC and local time.
- Base64 Encoder & DecoderEncode text to Base64 or decode Base64 back to text, right in your browser. Handles emoji and accented characters correctly, with URL-safe output.