Base / Radix Converter

Convert between 2/8/10/16 and any 2–36 bases, with BigInt for large numbers and grouped binary output.

—

Base / Radix Conversion: Hex Digits, Bits, and the Byte Boundary

Conversion is positional notation

The same value writes differently in different bases. 255 in binary is 11111111, in octal is 377, and in hex is FF. They are one number; only the weight per digit changes (powers of 2, 8, or 16 respectively).

So base conversion does not change the value, only its written form — exactly like "255" and "0xFF" being the same number.

Why programmers use hexadecimal

The key point: one hex digit maps exactly to 4 bits (since 16 = 2⁴), and a byte is 8 bits, so one byte is two hex digits. That clean mapping makes reading and writing trivial:

BinaryHexDecimalNote
1010A104 bits = 1 hex digit
11111111FF2551 byte = 2 hex digits
1010 1010AA170Grouped for eyeball checking

Write the same byte in decimal and you cannot see the bit pattern at a glance. That is why memory addresses, color values (#FF5733), hashes, character encodings, packet analysis, and permission masks all use hex.

This tool groups binary output every 4 bits with a space, precisely to match that mapping — one group is one hex digit, easy to verify by eye.

Bit-width reference

WidthUnsigned rangeSigned range (two's complement)
8 bit0 – 255 (0xFF)−128 – 127
16 bit0 – 65535 (0xFFFF)−32768 – 32767
32 bit0 – 4294967295 (0xFFFFFFFF)−2147483648 – 2147483647
64 bitmax ≈ 1.8 × 1019≈ ±9.2 × 1018

Seeing 0xFF should instantly suggest 255 (a byte fully set); 0xFFFFFFFF suggests a 32-bit field fully set — basic intuition when reading code and logs.

Important concept: the same bit pattern means different numbers under signed versus unsigned interpretation. For example 0xFF: unsigned is 255, signed two's-complement is −1. So "FF means 255" is wrong wherever signed types are involved. Negative numbers in two's complement set the top bit to 1, a common source of overflow bugs.

Why BigInt is needed

JavaScript numbers are IEEE 754 doubles, which represent integers exactly only up to 253 − 1 = 9007199254740991. Beyond that, integer math loses precision — fatal for base conversion, because crypto-related values (hashes, keys, blockchain addresses) routinely exceed it.

This tool uses BigInt, so it is free of the 253 limit and handles arbitrarily long integers while memory allows. You can safely convert 64-bit, 128-bit, or longer integers without trailing digits turning to zero or garbage.

Common mistakes

How to use the tool

  1. Enter the number in the value box (e.g. 1010 or FF).
  2. Pick the from-base and to-base; any base from 2 to 36 is supported.
  3. Convert. Binary output groups every 4 bits for easy hex comparison.

It fits bit-mask verification (turn a hex mask into binary and count which bits are 1), color-value conversion, permission decoding, and checking received hex data. All runs locally in the browser.

FAQ

How large a number is supported?

BigInt is used, so any integer length is handled as long as memory allows, free of the 2^53 limit.

Why group the binary output?

Binary gets very long; grouping every 4 bits (a nibble) with spaces aids reading and manual checking.