Hex to Decimal Converter

Convert hexadecimal numbers to decimal, binary and octal with powers of 16 shown step by step. Hexadecimal is base 16. Example: with hexadecimal number 1A3, the result is Decimal = 419; Binary = 110100011; Octal = 643.

Last updated · By · Runs in your browser, nothing is uploaded

Result

Step-by-Step Solution

Enter your values above to see the full working.

How do you use the Hex to Decimal Converter?

Enter a hexadecimal number using the digits 0 to 9 and the letters A to F. Upper and lower case both work, and an optional 0x prefix is removed for you, so values like 0xFF, ff and 1A3 are all accepted. The decimal result, binary and octal equivalents appear at once.

The working lists the value of each hex digit multiplied by its power of 16, which is a handy way to learn the method or to check a homework answer.

What formula does the Hex to Decimal Converter use?

Hexadecimal is base 16. It needs 16 symbols, so after 9 it uses A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Place values are powers of 16: 1, 16, 256, 4,096, 65,536 and so on from right to left.

To convert, multiply each digit by its place value and add the results. The formula is Σ dᵢ × 16ⁱ. Hex is popular in computing because one hex digit corresponds exactly to four binary bits, so a byte (8 bits) is always exactly two hex digits.

Worked examples: 1A3 and FF

For 1A3: 1 × 256 + 10 × 16 + 3 × 1 = 256 + 160 + 3 = 419. For FF: 15 × 16 + 15 = 255, the largest value a single byte can hold. Converting hex to binary directly is even simpler: replace each digit with its four-bit pattern, so 1A3 becomes 0001 1010 0011.

Where hexadecimal is used

Web colours are written in hex: #FF5733 means red 255, green 87 and blue 51, found by converting each pair of digits. Memory addresses, MAC addresses, error codes, file signatures and character encodings are also shown in hex because it is compact and aligns neatly with bytes.

Developers read hex dumps daily, and converting a few values by hand builds intuition. For instance, 0x7F is 127, the largest signed byte, and 0x80 is 128, the point where the sign bit flips.

What are the most common mistakes with the Hex to Decimal Converter?

  • Treating the letters as invalid. A to F are ordinary digits worth 10 to 15.
  • Using powers of 10 instead of powers of 16 when multiplying.
  • Confusing hex values with decimal when a number happens to contain only digits 0 to 9, such as 100, which is 256 in hex.
  • Forgetting that hex is case-insensitive, so ff and FF are the same number.

What Is the Tested Example for the Default Values?

This example is computed by the same code that powers the calculator above, so you can compare it with your own numbers or a textbook answer.

Input: Hexadecimal number1A3
Decimal419
Binary110100011
Octal643
Hex digits3

Where Can You Verify These Formulas?

The definitions and formulas on this page follow standard references. Check them against these sources:

Built and maintained by S. Dilshan. Found a mistake? Email [email protected] with the page address.

Frequently Asked Questions

How do I convert hex to decimal by hand?

Multiply each digit by 16 to the power of its position from the right, using A to F as 10 to 15, and add. For 2F: 2 × 16 + 15 = 47.

What does 0x mean in front of a number?

It is a common prefix that tells programmers the digits that follow are hexadecimal, such as 0x1F.

Why do programmers use hex instead of binary?

Hex is far shorter, and each digit maps exactly to four bits, so converting between hex and binary is quick and error-free.