Number Base Converter

Convert between binary, octal, decimal, hex, and ASCII text with exact 64-bit BigInt math. Runs entirely in your browser.

Input

How it works

About Number Base Converter

Binary, octal, decimal, and hex are the same number in different uniforms — bit flags, color channels, and network masks are far easier to read in the right base. This converter shows every base at once, so you can flip between them without re-entering anything, and it accepts 0x / 0b / 0o prefixes so you can paste a value exactly as it appears in code.

Because browsers compute integers losslessly only up to 2^53, this tool uses BigInt throughout: values up to 64 bits convert exactly. The signed interpretation rows are the usual two’s-complement reading for 8/16/32/64-bit widths, which is what debuggers and CPU registers show when the high bit is set.

Exact integers, parsed one digit at a time

Input goes through a hand-written Horner loop — `v = v * base + digit` over a `BigInt` — with every character checked against the alphabet `0123456789abcdef` truncated to the selected radix. That per-digit validation is the reason an invalid character is an error instead of a surprise: `parseInt` stops at the first character it cannot use and ignores the rest, so `parseInt('12abc', 10)` is 12 and `parseInt('0x1F', 10)` is 0, both quietly wrong for this purpose.

A leading `0x`, `0b` or `0o` overrides the base dropdown, matched case-insensitively after lowercasing, so a value pasted straight out of source code is read correctly even when the selector says decimal. Values are bounded at the unsigned 64-bit maximum before the sign is applied, and everything stays in `BigInt` throughout — which is what makes values above 2^53 convert exactly where ordinary JavaScript numbers would round.

Two's complement is a reading, not another base

The signed row is derived by width, not by base: for each of 8, 16, 32 and 64 bits, if the value fits that width, it is reported as itself or as value-minus-2^width when the top bit is set. So 255 reads as `8-bit: -1, 16-bit: 255, 32-bit: 255, 64-bit: 255`, which is exactly what a debugger and a CPU register show for the same bytes under different widths.

Negatives take a different path, and it is worth knowing which one you are reading: binary, octal and hex are all rendered from the magnitude with a leading minus, not from the two's complement bit pattern. `-1` therefore displays as binary `1` and hex `0x1`, where a 32-bit register would show `0xFFFFFFFF`. The signed rows are also omitted entirely for negative input, and a signed zero loses its sign during magnitude normalisation and comes back as plain `0`.

Text in, bytes out — and where UTF-8 goes missing

ASCII mode packs one character per byte, most significant first: `Hi` becomes 0x4869. That one-byte-per-character rule is Latin-1 behaviour, not UTF-8, so `é` contributes a single `0xE9` where UTF-8 would emit the two-byte pair `0xC3 0xA9`. Characters beyond the BMP are worse: iteration yields the whole code point but `charCodeAt(0)` keeps only the high surrogate, so an emoji is packed as its lone `0xD83D` rather than the four UTF-8 bytes `0xF0 0x9F 0x98 0x80`.

Input longer than eight characters falls back to a per-character code list instead of a packed integer, since eight bytes is what a 64-bit word holds. The `Character` row appears only for non-negative values at or below 0x10FFFF, and in the surrogate range 0xD800-0xDFFF that row renders a lone surrogate rather than an emoji — the pair is what carries the character. There is no floating-point mode at all here, which is why IEEE 754 rounding and negative zero never enter the picture.

Frequently Asked Questions

How do I convert between number bases?
Enter a number in any base (binary, octal, decimal, hexadecimal, or base-36 to base-64), select the input base, and the tool shows the equivalent value in all other bases simultaneously.
What bases are supported?
Binary (base-2), octal (base-8), decimal (base-10), hex (base-16), and custom bases from 2 to 64 using RFC 4648 alphabet. You can also use custom digit alphabets.
Is my data sent to a server?
No. Every tool on jsonversal runs entirely in your browser using the Web Crypto API, File API, and Clipboard API. Nothing is ever uploaded — not even the JSON you paste in.
Do I need an account or API key?
No signup, no email, no API key. All tools are free to use with no signup required.
Can I use these tools offline?
Yes. Once the page loads, all tools work offline. There are no external API calls or CDN dependencies at runtime.
🔒
Your data never leaves your device

All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.

esc
↑↓ navigate ↵ open esc close