Convert numbers between binary, decimal, hexadecimal, octal and any base from 2 to 36. Exact for huge numbers, with two's complement for negatives.
💡 Would you like a new tool or feature, or did something not work? Tell us at [email protected]
How to convert between bases
Type a number into any box: decimal, hexadecimal, binary, octal, or a base of your choice (2 to 36). The others update instantly. You can paste numbers with a prefix (0x, 0b, 0o) and with spaces or underscores for grouping.
Quick reference
Dec
Hex
Bin
Dec
Hex
Bin
0
0
0000
8
8
1000
1
1
0001
9
9
1001
2
2
0010
10
A
1010
3
3
0011
11
B
1011
4
4
0100
12
C
1100
5
5
0101
13
D
1101
6
6
0110
14
E
1110
7
7
0111
15
F
1111
Frequently asked questions
How do I convert binary to decimal?
Each binary digit is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. Add the values where there's a 1. For example, 1011 is 8 + 0 + 2 + 1 = 11. Type any binary number above and the decimal value appears instantly.
Why do programmers use hexadecimal?
One hex digit is exactly four binary digits, so long binary numbers become short and readable: 11111111 is FF. That's why colors (#FF8800), memory addresses and byte values are usually written in hex.
What is two's complement?
It's how computers store negative integers. In 8 bits, -1 is 11111111 and -128 is 10000000. Pick a bit width to see the two's complement form of a negative number.
Is there a size limit?
No practical limit: the converter uses arbitrary-precision integers (BigInt), so even numbers with hundreds of digits convert exactly.