Free · Big-integer precise · Instant

Number base converter

Convert a number between binary, octal, decimal, hexadecimal and any base from 2 to 36 — instantly, with exact big-integer math.

Binary
Octal
Decimal
Hexadecimal
Base 36

🔒 Runs entirely in your browser — instant and private.

How to convert number bases

Convert a value between binary, octal, decimal, hexadecimal and any base from 2 to 36 at once — with exact big-integer math, so even huge numbers stay precise.

⌨️

1. Type a number

Enter your value — for example 255, 0xFF or 0b1010.

🎯

2. Pick the base

Select the input base or use Auto-detect, which reads 0x, 0b and 0o prefixes.

📋

3. Copy any result

All bases convert live; copy binary, hex, decimal, octal or a custom base with one click.

Programmers and students use base conversion for bitmasks and flags, color values (hex like #FF8800), memory addresses, file permissions (octal), networking, and low-level debugging. Common conversions include binary to decimal, decimal to binary, hex to decimal and decimal to hex. Because this tool uses big-integer arithmetic, values far beyond 64 bits convert exactly with no rounding errors.

Why hexadecimal is everywhere in computing

Hexadecimal is convenient for one specific reason: 16 is 2⁴, so each hex digit maps to exactly four bits with no remainder. A byte is therefore always two hex digits, and converting between hex and binary is a per-digit substitution requiring no arithmetic.

That property is why hex appears wherever raw bytes do — colour codes, memory addresses, hashes, MAC addresses, character encodings. Decimal has no such alignment: 255 in decimal gives no indication that it is the largest value a byte can hold, while FF makes it obvious.

Octal survives mainly in Unix file permissions, where three bits map neatly to one digit and 755 compactly encodes read, write and execute for owner, group and others. It is otherwise largely historical, from architectures with word sizes divisible by three. Beware that a leading zero denotes octal in C and several other languages, so 010 is 8 — a genuine source of bugs in code handling zero-padded numbers.

Negative numbers and two's complement

Converting a negative number between bases is only well defined once you decide how negatives are represented. Modern hardware uses two's complement: the most significant bit indicates sign, and a negative value is stored as the bitwise complement of its magnitude plus one.

In eight bits, −1 is 11111111 and −128 is 10000000. The scheme is used because addition and subtraction work identically for signed and unsigned values, so the hardware needs one adder rather than two. Its asymmetry is a consequence: an 8-bit signed range is −128 to +127, with one more negative value than positive, so negating −128 overflows.

This is why a hex value such as FFFFFFFF is 4,294,967,295 read as unsigned and −1 read as signed. The bits are identical; only the interpretation differs, and a converter must be told which you mean.

Where conversions go wrong

Width matters as much as value. FF is 255 in eight bits and 255 in sixteen bits, but sign-extending an 8-bit −1 into 16 bits gives FFFF, not 00FF. Converting without knowing the width silently produces the wrong number for negative values.

Byte order is the other pitfall. Little-endian machines — x86 and most ARM configurations — store the least significant byte first, so the 32-bit value 0x12345678 appears in memory as 78 56 34 12. Network protocols conventionally use big-endian, which is why raw bytes read from a file or a socket often appear reversed.

Fractional values are the messiest case. Most decimal fractions have no finite binary representation, so 0.1 in binary repeats forever and must be truncated — the root of the familiar floating-point rounding surprises. Integer conversion between bases is exact; fractional conversion generally is not.

Number base converter FAQ

Which bases are supported?

Binary (2), octal (8), decimal (10), hexadecimal (16) and any custom base from 2 to 36.

Does it handle very large numbers?

Yes — it uses big-integer math, so even huge values convert exactly without rounding.

How does auto-detect work?

Prefixes are recognised: 0x = hex, 0b = binary, 0o = octal; otherwise it's read as decimal.

Is it free?

Yes — completely free and it runs entirely in your browser.

How are negative numbers shown?

By default with a minus sign. Switch "Negative numbers" to an 8/16/32/64-bit two's complement width to see the actual bit pattern a computer would store — e.g. -1 as 8-bit two's complement is 11111111. If a value doesn't fit the chosen width, it falls back to the signed form with a warning.

Why does the same hex value show as two different numbers?

Because signed and unsigned interpretations differ. FFFFFFFF is 4,294,967,295 unsigned and −1 signed under two's complement — identical bits, different reading.

Why does 010 sometimes mean 8?

A leading zero denotes octal in C, Java and several other languages. Modern languages tend to require an explicit 0o prefix precisely because the old convention caused bugs with zero-padded input.