How to Convert Hex to Decimal (Step by Step)

Programmers, students and designers all need to know how to convert hex to decimal at some point – for memory addresses, error codes, byte values or colour codes. Hexadecimal looks strange because it mixes numbers and letters, but the method is the same one you use for ordinary numbers, just with 16 instead of 10.

Screenshot of the Hex to Decimal Converter on Assen Tools
The Hex to Decimal Converter in use. Open the Hex to Decimal Converter – free, no sign-up.

What hexadecimal is

Hexadecimal is base 16. It needs sixteen digits, so after 0–9 it uses letters:

Hex A B C D E F
Decimal 10 11 12 13 14 15

Each position is worth a power of 16, counting from the right: 1, 16, 256, 4096, 65,536 and so on.

The method

  1. Write the place values under each digit, starting with 1 on the right: 1, 16, 256, 4096…
  2. Convert any letters to their decimal values.
  3. Multiply each digit by its place value.
  4. Add the results.

Worked examples

2F

  • 2 × 16 = 32
  • F (15) × 1 = 15
  • 32 + 15 = 47

FF

  • 15 × 16 = 240
  • 15 × 1 = 15
  • 240 + 15 = 255 – the largest value of one byte.

1A3

  • 1 × 256 = 256
  • A (10) × 16 = 160
  • 3 × 1 = 3
  • 256 + 160 + 3 = 419

The Hex to Decimal converter shows this table of digits, powers and values for any number you type, including very large ones.

Colour codes

Web colours such as #1E90FF are three hex pairs – red, green and blue. Convert each pair separately:

  • 1E = 1 × 16 + 14 = 30
  • 90 = 9 × 16 + 0 = 144
  • FF = 255

So #1E90FF is RGB(30, 144, 255). The Color Picker shows both forms, and our guide on how to find the color code from an image explains where codes come from.

Quick reference

Hex Decimal
A 10
F 15
10 16
20 32
64 100
7F 127
80 128
FF 255
100 256
3E8 1000
FFFF 65,535

Going the other way

To convert decimal to hexadecimal, divide by 16 repeatedly and read the remainders upwards – see how to convert decimal to hexadecimal or use the Decimal to Hex converter. For binary, each hex digit is exactly four bits: the Hex to Binary converter shows the groups.

Where you will meet hex

Hexadecimal turns up in more places than you might expect:

  • Web design: colour codes such as #FF5733 and CSS values.
  • Programming: memory addresses, bit masks and constants such as 0x7FFFFFFF.
  • Networking: MAC addresses (00:1A:2B:3C:4D:5E) and IPv6 addresses are written in hex.
  • Error codes: Windows stop codes and many device error messages use hex values.
  • Unicode: characters are identified by hex code points, such as U+00E9 for é.

A faster method for long numbers

For long hex numbers, use the "multiply and add" method instead of working out big powers of 16. Start with the first digit, then for each next digit multiply the running total by 16 and add the digit. For 1A3: start with 1 → 1 × 16 + 10 = 26 → 26 × 16 + 3 = 419. It gives the same answer with smaller numbers at each step.

Frequently asked questions

Is hexadecimal case-sensitive? No. ff, FF and fF all mean 255.

What does 0x mean? It is a prefix programmers use to show a number is hex, as in 0xFF. Ignore it when converting.

Why do computers use hex? One hex digit equals exactly four binary digits, so long binary values become short and readable.

How do I convert a hex number with a point? Digits after the point are worth 1/16, 1/256 and so on. 0.8 in hex is 8/16 = 0.5 in decimal.

Once you know how to convert hex to decimal, codes like 0x1F4 and #FF8800 stop looking mysterious.

Jonathan Nwachukwu, founder of Assen Tools

Written by

Jonathan Nwachukwu · Founder & developer

Jonathan is a freelance web developer and web development teacher who builds Laravel, WordPress and WooCommerce sites for clients. He built AssenTools to put the everyday file, photo and calculation jobs he kept doing for clients and students into one free, private toolbox, and he maintains every tool and guide on the site.