Hex Converter

Enter a hexadecimal number, with or without the 0x prefix, and press Convert hex. You get it in decimal, binary, and octal, each hex digit as its four bits, the place value working, and a table of every base from 2 to 36.

Try an example

About this hex converter

Hexadecimal is base 16: it uses the digits 0 to 9 and the letters A to F for the values 10 to 15. Because one hex digit stands for exactly four bits, programmers use it for memory addresses, colour codes, byte values, hashes, and error codes such as 0xDEADBEEF. This converter accepts upper or lower case, an optional 0x prefix, and a minus sign, and converts exactly to decimal, binary, octal, and every other base up to 36. It also lays out each digit as its four bits and walks through the place value calculation.

How to convert hex to decimal

  1. Enter the hex number. Type the number, for example FF or 0xCAFE, or press an example.
  2. Press Convert hex. The decimal value appears, with binary and octal below it.
  3. Read the breakdown. See each hex digit as four bits and follow the step-by-step table to decimal.
  4. Find another base. Scroll to Every base from 2 to 36, or type a base in Filter by base to jump to it.

Frequently asked questions

How do I convert hex to decimal by hand?

Multiply each digit by 16 raised to its position, counting from 0 on the right, and add the results. FF is 15 × 16 + 15 × 1 = 255, and 1A3F is 4096 + 2560 + 48 + 15 = 6719.

What does the 0x prefix mean?

It is a marker used in C, JavaScript, Python, and many other languages to say that a number is written in hex. It is not part of the value, so 0xFF and FF are the same number.

How do I turn hex into binary quickly?

Replace each hex digit with its four bits: C is 1100, A is 1010, F is 1111, and E is 1110, so CAFE is 1100 1010 1111 1110. The digit breakdown does this for you.

Are lower-case letters accepted?

Yes. Hex is not case sensitive, so ff, Ff, and FF all mean 255. Results are always shown in upper case.