Number Base Converter

Convert numbers between binary, octal, decimal and hexadecimal (or any base from 2 to 36), with no size limit.

Prefixes 0x, 0b and 0o are recognised; spaces and underscores are ignored.

Used as the input base when "Custom" is chosen, and always shown as an extra output.

Decimal
65518

Read as hexadecimal

Bits needed
16
Hexadecimal
FFEE
Binary
1111111111101110
Octal
177756
Custom base
1EJY (base 36)

Runs entirely in your browser. Nothing you enter is uploaded.

Formula

value = Σ digitᵢ × baseⁱ (i counted from the right, starting at 0)

How it works

A number base says how many distinct digits are used before you carry to the next position. Decimal uses ten (0–9), binary two (0 and 1), octal eight (0–7) and hexadecimal sixteen (0–9 then A–F). The value is the same; only the way it is written changes. For example 255 in decimal is 11111111 in binary and FF in hex.

Programmers use hex because each hex digit maps to exactly four bits, so a byte is always two hex digits — handy for colors (#FF8800), memory addresses and byte dumps. Octal survives mainly in Unix file permissions such as 755. Bases above 16 continue with letters up to Z for base 36, which is sometimes used for short IDs.

Conversions use arbitrary-precision integers (BigInt), so 64-bit, 128-bit and even longer values convert exactly with no rounding. Negative numbers are shown with a minus sign rather than in two's complement. Everything is calculated in your browser.

Frequently asked questions

How do I convert binary to decimal by hand?

Multiply each bit by its place value (1, 2, 4, 8, … from the right) and add them up. 1011 = 8 + 0 + 2 + 1 = 11.

Why does "Bits needed" matter?

It tells you the smallest integer type that can hold the value: up to 8 bits fits a byte, 32 bits an int32, 64 bits an int64 (unsigned). Signed types need one more bit.

Does it handle fractions?

No — only whole numbers. Fractional parts often have no exact representation in another base (0.1 in decimal repeats forever in binary).

esc