Skip to content

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36. Arbitrary-precision arithmetic means 64-bit IDs, 256-bit hashes and larger values convert exactly, and negative numbers show their two's-complement form. Runs entirely in your browser.

Runs in your browserFreeNo sign-up

Processed on your device. Files and text stay in your browser and are not uploaded to our servers. How privacy works

How to use the number base converter

  1. Choose the base your number is written in, then type it. Prefixes such as 0x, 0b and 0o are recognised, as are spaces, underscores and commas between digits.
  2. Read the binary, octal, decimal and hexadecimal results at once. Pick an Extra base to see, for example, base 36 or base 3 as well.
  3. Turn on grouping by nibbles or bytes to make long binary and hex values readable, and choose uppercase or lowercase letters.
  4. Copy any result with the button next to it.

Features

  • Exact conversion of numbers of any size using BigInt, not floating point
  • All common bases shown at once, plus any custom base from 2 to 36
  • Validation that names the offending digit for the chosen base
  • Nibble and byte grouping, optional 0x/0b/0o prefixes, uppercase or lowercase
  • Bit length, sign and two's-complement representation for negative values

How positional bases work

In base b, each digit position is worth a power of b: the hexadecimal number 2F means 2 × 16 + 15 = 47. Bases above 10 use letters for the extra digits, A = 10 up to Z = 35, which is why base 36 is the largest base representable with digits and the Latin alphabet. Binary, octal and hex are popular because each octal digit is exactly 3 bits and each hex digit exactly 4, so converting between them is a matter of grouping bits.

Why BigInt matters

JavaScript's normal numbers are 64-bit floats that only represent integers exactly up to 2^53 (about 9 quadrillion). Snowflake IDs, Ethereum addresses, SHA-256 digests and IPv6 addresses are all bigger than that, and a converter using floating point silently rounds them. This tool uses BigInt so every digit is preserved regardless of size.

Negative numbers and two's complement

Mathematically, -5 in binary is simply -101. Computers instead store negatives in two's complement within a fixed width: -5 as an 8-bit value is 11111011 (0xFB). When the input is negative, the tool shows the smallest standard width (8, 16, 32, 64, 128 or 256 bits) that fits and the corresponding two's-complement value, which is what you'll see in a debugger or a packet dump.

Frequently asked questions

Can it convert fractions or decimals like 3.14?

No, this converter handles integers only. Fractional conversion between bases is rarely needed and results in repeating digits for most values.

Why does 0x10 fail when the input base is decimal?

The 0x prefix means hexadecimal. Either switch the input base to 16 or remove the prefix; the error message tells you which prefix was found.

How large a number can I enter?

There is no fixed limit. Numbers with thousands of digits convert instantly because the arithmetic is arbitrary precision.

Does anything leave my browser?

No. Parsing and conversion run locally in JavaScript; the number you enter is never transmitted.

Other tools people use alongside Number Base Converter.

You might also like

Something useful from another corner of VoltKit.