Number base converter

Type in any box and the others update: binary, octal, decimal, hex, plus a custom base from 2 to 36. Large integers stay exact.

How base conversion works

To convert to base b, divide by b repeatedly and read the remainders from last to first. To convert from base b, multiply each digit by b raised to its position.

0xFF = 15 × 16¹ + 15 × 16⁰ = 240 + 15 = 255

Quick reference

DecimalBinaryOctalHex
0000
1111
21022
711177
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1000111110100017503E8
1024100000000002000400
40961000000000000100001000
655351111111111111111177777FFFF

Prefixes 0x, 0b and 0o are accepted and ignored; underscores and spaces are allowed as digit separators.

Frequently asked questions

Why is hex used in programming?
One hex digit is exactly 4 bits, so a byte is always two hex digits. That makes memory addresses, colors and hashes compact and easy to map to binary.
What is the largest number supported?
There is no practical limit; the tool uses BigInt, so hundreds of digits stay exact.