Binary, Hex & Decimal Converter
Convert numbers between binary, octal, decimal and hexadecimal, including very large values.
How number bases work
In base 10 each position is worth ten times the one to its right. In binary (base 2) each position is worth twice as much, in hexadecimal (base 16) sixteen times. Hexadecimal uses the letters A–F for the values 10–15.
Binary 11111111 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255, which is FF in hexadecimal and 377 in octal.
Why programmers use hex
Each hex digit represents exactly four binary digits (bits), so a byte is always two hex digits. Web colors such as #1F6F5C are three bytes for red, green and blue. Memory addresses, file signatures and network hardware (MAC) addresses are also written in hex.
Converting decimal to binary by hand
Divide by 2 repeatedly and write down the remainders, then read them from bottom to top. 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1, so 13 is 1101 in binary.
This converter uses arbitrary-precision arithmetic, so it handles numbers far larger than a typical calculator.
Frequently asked questions
How do I convert binary to decimal?
Multiply each bit by its place value (1, 2, 4, 8, …) from the right and add the results.
What is 255 in binary?
11111111, the largest value that fits in one byte.
What does 0x mean?
The prefix 0x marks a hexadecimal number in programming, for example 0xFF = 255.
Last reviewed October 2026. Results are estimates; check important decisions with a qualified professional.