Number Base Converter — Binary, Octal, Decimal, Hex & Any Base

Type in any field and the rest update — exact at any size, with two's complement for negatives.

🔒 Runs in your browser — files never uploaded ⚡ No signup 💯 Free

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36. Type in whichever field you have and the others update live. The arithmetic is exact at any size — 64-bit hashes, 128-bit UUIDs and beyond come out right, where most converters silently round past 253.

Negative numbers get their two's complement representation at 8, 16, 32 or 64 bits, because "what is −1 in hex" has no answer until you say how wide the integer is.

How to use Number Base Converter

  1. Type a number into any field — decimal, hex, binary, octal, or the custom base of your choice. Prefixes like 0x and 0b and digit separators are accepted.
  2. Read the others. Digit grouping makes long binary and hex readable; toggle it off for a copy-paste value.
  3. Check the size line — bits, bytes, and the smallest unsigned integer type it fits.
  4. For negatives, pick a bit width to see the two's complement bit pattern and hex.

Why exactness matters here

JavaScript's parseInt and toString(2) — and the calculators built on them — work in floating point, exact only up to 253 (about 9 × 1015). Anything larger, which is precisely what people bring to a base converter (SHA hashes, 64-bit IDs, bitmasks), gets rounded to the nearest representable value with no warning. This converter uses arbitrary-precision integers, so 18446744073709551615 converts to FFFFFFFFFFFFFFFF, not 10000000000000000.

The four bases programmers meet

  • Binary (2) — what the hardware stores. One digit per bit, so it is the only base where flags and masks are visually obvious.
  • Octal (8) — three bits per digit. Mostly survives in Unix permissions (755) and escape sequences.
  • Hexadecimal (16) — four bits per digit, so a byte is exactly two hex digits. Colours, memory addresses, hashes, MAC addresses.
  • Decimal (10) — for humans. Note the mismatch: a "round" decimal like 1000 is 1111101000 in binary, and a round binary like 1024 looks arbitrary in decimal.

Two's complement, briefly

Computers store a negative integer by adding 2bits to it: in 8 bits, −1 becomes 255 (11111111), −128 becomes 128 (10000000). The top bit doubles as the sign, addition works unchanged, and the range is asymmetric (−128 to +127). The width is essential — 0xFF is −1 as a signed byte and 255 as an unsigned one, or 255 as a 16-bit value of either kind. The converter shows both readings and tells you when a value does not fit the chosen width.

Bases beyond 16

Base 36 (digits then a–z) is the largest that stays case-insensitive, which is why short IDs and URL slugs use it. Base 32 and base 64 are encodings with their own alphabets and padding rules — for those, use the Base64 tool; for bytes of text rather than a single number, the text to binary converter.

Frequently asked questions

Why does my large number come out wrong in other converters?

They use floating-point arithmetic, which is exact only up to 253 (≈ 9 quadrillion). Above that, values are rounded to the nearest representable number — a 64-bit hash loses its last few digits with no warning. This converter uses arbitrary-precision integers, so any length is exact.

How do I convert a negative number to binary?

You have to pick a width. Computers store negatives in two's complement: in 8 bits, −1 is 11111111; in 16 bits it's sixteen ones. Enter the negative decimal and choose 8/16/32/64-bit in the two's complement panel to see the stored bit pattern and its hex.

Can I paste 0xFF or 0b1010?

Yes — 0x, 0b and 0o prefixes are recognised in their fields, and spaces, underscores and commas between digits are ignored, so 1111 1111 and 1_000_000 both parse.

What is the largest base supported?

Base 36: digits 0–9 followed by a–z. Beyond that there's no natural case-insensitive alphabet, and schemes like Base64 are encodings with their own rules — use the Base64 tool for those.

Does it handle fractions?

No — integers only. Fractional binary and hex (0.1 = 0.0001100110011…) are a different problem, mostly of interest for understanding floating-point representation.