Number Base Converter

Convert binary, octal, decimal and hexadecimal side by side, or switch to any base from 2 to 36. Very large and negative numbers are converted exactly.

Any base (2 to 36)

Digits above 9 are written A=10, B=11 … Z=35. Upper and lower case are treated the same.

Bits
—
Bytes
—
Two’s complement
—

About the Number Base Converter

Type a number into any field and all the others update instantly. The converter shows the bases you need most in programming, computer science and electronics – binary (BIN), octal (OCT), decimal (DEC) and hexadecimal (HEX) – and the lower box lets you pick any base from 2 to 36.

It uses exact arbitrary-precision integers (BigInt), so numbers like 2⁶⁴ convert without rounding errors, and negative numbers also show their two’s complement representation.

How to use

  1. Type a number into the field for the base you know. The other fields update automatically.
  2. Prefixes 0x (hex), 0b (binary) and 0o (octal) are accepted; spaces and _ separators are ignored.
  3. For other bases, choose 2–36 under Any base and type the value there.
  4. Use the Copy button next to each field to copy the result.

How base conversion works

Decimal → base N: divide by N repeatedly and read the remainders from bottom to top. Example: 13 → 13÷2 = 6 r 1, 6÷2 = 3 r 0, 3÷2 = 1 r 1, 1÷2 = 0 r 1 → 1101₂

Base N → decimal: multiply each digit by the matching power of N and add them up. Example: 1A₁₆ = 1×16 + 10×1 = 26

Binary ↔ hex: group binary digits in fours from the right; each group is one hex digit (groups of three for octal). 1101 0111₂ = D7₁₆

Common values

DecimalBinaryOctalHex
81000108
10101012A
15111117F
16100002010
100110010014464
25511111111377FF
1024100000000002000400
655351111111111111111177777FFFF

Negative numbers and two’s complement

The converter writes negative numbers with a minus sign, as in math: −1010₂. Computers usually store negatives in two’s complement, where −x in n bits is 2ⁿ − x. Example: −10 in 8 bits = 256 − 10 = 246 = 1111 0110₂ (0xF6). The info box shows the two’s complement in the smallest width that fits (8, 16, 32, 64 or 128 bits).

FAQ

Can it convert very large numbers?

Yes. It uses integers without a digit limit, so numbers with dozens of digits convert exactly. Numbers with a fractional part are not supported.

Can I type lowercase hex?

Yes. Input is case-insensitive; results are shown in uppercase (A–F).

Why does it stop at base 36?

The ten digits 0–9 plus the 26 letters A–Z give 36 symbols. Base 36 is sometimes used for short IDs and URL shorteners.