AltUtils

Number Base Converter

Convert numbers between binary, octal, decimal, hexadecimal and any base from 2 to 36, including arbitrarily large integers.

CategoryConverters
Sheet20 / 42
ProcessingIn your browser
Try:
base 2 · 0b
base 8 · 0o
base 10
base 16 · 0x

Size & binary representation

Bit length
8 bits
Byte length
1 byte
Signed width
9 bits
Decimal digits
3

Two's complement (fixed width)

  • 8-bit
    11111111
    Hex 0xFFSigned -1Unsigned 255
  • 16-bit
    00000000 11111111
    Hex 0x00FFSigned 255Unsigned 255
  • 32-bit
    00000000 00000000 00000000 11111111
    Hex 0x000000FFSigned 255Unsigned 255
  • 64-bit
    00000000 00000000 00000000 00000000 00000000 00000000 00000000 11111111
    Hex 0x00000000000000FFSigned 255Unsigned 255

Negative numbers are shown as the bit pattern a CPU stores; values above the signed maximum show how the same bits read as a signed integer.

What is the Number Base Converter?

A number base (radix) is how many distinct digits a positional system uses. Decimal uses ten (0–9), binary two (0 and 1), octal eight (0–7) and hexadecimal sixteen (0–9 and A–F). Each hex digit maps to exactly four bits and each octal digit to three, which is why programmers use hex for memory addresses, colors and byte values, and octal for Unix file permissions.

This converter uses JavaScript BigInt, so it handles integers far beyond the 2⁵³ limit of regular numbers — 64-bit IDs, cryptographic values or numbers with tens of thousands of digits convert exactly, with no rounding. You can paste values the way they appear in code: prefixes such as 0x, 0b and 0o, a leading minus sign, and separators like 1_000_000, 1,000,000 or FF FF are all understood. Invalid digits are pointed out with their position instead of being silently ignored.

For low-level work, the details panel shows how many bits and bytes a value needs and its two's-complement encoding in 8, 16, 32 and 64 bits. That makes it easy to see that −1 is stored as 0xFF in a byte, or that the unsigned byte 200 reads as −56 when interpreted as a signed int8.

Frequently asked questions

How do I convert binary to decimal by hand?
Multiply each bit by its power of two and add the results, starting with 2⁰ at the rightmost bit. For 1011: 1×8 + 0×4 + 1×2 + 1×1 = 11.
How are negative numbers represented in binary?
Mathematically a negative number is just a minus sign plus the magnitude (−1010). Computers use two's complement in a fixed width instead: invert all bits of the magnitude and add one, so −6 in 8 bits is 11111010 (0xFA). The fixed-width table shows both readings of the same bits.
What is the largest number I can convert?
Up to 100,000 digits per field. Because the conversion uses BigInt, every digit is exact — unlike calculators built on floating-point numbers, which start rounding above 9,007,199,254,740,991.
Which digits are used for bases above 10?
Letters continue after 9: A = 10, B = 11, … up to Z = 35 in base 36. Input is case-insensitive, and the uppercase option controls how hex and custom-base results are displayed.
Why does 0b1 in the hex field not mean binary?
In hexadecimal, B is a valid digit, so 0b1 is the hex number 0B1 (177 decimal). Prefixes are only stripped when they match the field (0x for hex, 0b for binary, 0o for octal); in the decimal field any of the three prefixes is accepted and switches the base.
Can I convert fractions like 0.1?
No, this tool converts whole numbers only. Fractions such as decimal 0.1 have no finite binary representation, so they need a separate floating-point tool to show the rounding involved.