Number Base Converter

Type a number in any field and the others update instantly — binary, octal, decimal, hexadecimal, and any base from 2 to 36. The thing that makes this worth using over the first result you find is precision. Most base converters are built on parseInt, which holds integers exactly only up to about nine quadrillion and rounds silently above that: ask one for the decimal value of FFFFFFFFFFFFFFFF and you will get an answer whose last four digits are wrong, with nothing to tell you. Those large values are exactly what people convert — 64-bit IDs, hashes, flag masks, nanosecond timestamps. Everything here uses arbitrary-precision integers, so the result is exact at any size. Prefixes like 0x and 0b are accepted and ignored, as are spaces and underscores, so you can paste a literal straight from your code. Binary is also shown grouped in eights so it lines up with bytes.

The same value across bases

Base255FFFFFFFFFFFFFFFF
Decimal25518446744073709551615
Hexadecimalffffffffffffffffff
Octal3771777777777777777777777
Binary1111111164 ones
Base 36733w5e11264sgsf
parseInt would give25518446744073709552000 — wrong

When to use it

  1. Convert a 64-bit hex identifier to decimal without losing digits.
  2. Read a binary flag mask as hex, or the other way round.
  3. Check a permission value in octal.
  4. Work with an unusual base such as 36 for short identifiers.
  5. Paste a hex literal from source code and see it in decimal.

How to Use

  1. Type into whichever base you have a value in.
  2. The other bases update as you type.
  3. Use the Any base field for anything from 2 to 36, then copy.

Features

  1. Exact at any size — arbitrary-precision integers throughout
  2. Binary, octal, decimal, hex and any base from 2 to 36
  3. Live update across every field
  4. 0x, 0b and 0o prefixes accepted
  5. Spaces and underscores ignored, so code literals paste cleanly
  6. Negative values supported
  7. Binary grouped in eights, aligned to bytes
  8. The offending digit named when input is invalid
  9. 100% client-side

FAQs

Is my data uploaded?

No. Everything runs in your browser.

Why do other converters give a different answer for large numbers?

Because they use parseInt, which returns a double. Doubles hold integers exactly only to 2^53, roughly nine quadrillion, and round beyond it without any error. FFFFFFFFFFFFFFFF should be 18446744073709551615; parseInt gives 18446744073709552000. This tool uses arbitrary-precision integers, so it is exact.

How large a number can it handle?

There is no practical limit — hundreds of digits convert exactly. It is not restricted to 32 or 64 bits.

Can I paste 0xFF or 0b1010 directly?

Yes. The 0x, 0b and 0o prefixes are accepted and ignored, as are spaces and underscores, so a literal copied out of source code works without editing.

Are negative numbers supported?

Yes, with a leading minus, and the sign is preserved across bases. Note this is a signed value, not a two's-complement bit pattern — if you want the bit pattern of a negative integer, convert the unsigned value instead.

Why is the binary grouped from the right?

So the groups line up with byte boundaries. Grouping from the left would put a partial group at the end and make the last byte hard to read, which defeats the purpose.

Technical Details

Every conversion runs through arbitrary-precision integers rather than JavaScript numbers, and that single decision is the point of the tool. A JavaScript number is a double, so it holds integers exactly only up to 2 to the power of 53 — about nine quadrillion. Above that, parseInt and Number both start rounding, and they do it silently: parseInt of FFFFFFFFFFFFFFFF in base 16 returns 18446744073709552000, where the correct answer is 18446744073709551615. The last four digits are simply wrong, with no error and no warning, and the values where this happens — 64-bit identifiers, hashes, flags, addresses, timestamps in nanoseconds — are exactly the ones people reach for a base converter to inspect. Working in BigInt throughout means the answer is exact at any size, whether that is 64 bits or 600. Parsing is tolerant in the ways that save retyping: 0x, 0b and 0o prefixes are accepted and ignored, as are spaces and underscores, so a literal copied straight out of source code works; case is irrelevant; and a leading minus is handled. Validation is per digit and names the character that does not belong along with the base it was rejected for, which is more useful than a generic failure when the cause is usually one wrong character in a long string. Any base from 2 to 36 is available, not only the familiar four, and binary output is additionally shown grouped in eights from the right so the grouping aligns with byte boundaries rather than with the start of the string. Nothing is uploaded.

Developer Tools

Developer Tools

  • JSON Tree Viewer
  • JSON Flattener
  • JSON Diff Checker
  • JSONPath Extractor
  • JSON Schema Generator
  • License Generator
  • Nanoid Generator
  • Random String Generator