What Is the Hexadecimal (Hex) System?
The hexadecimal system, or hex for short, is a base-16 number system. While the decimal system only uses 10 digits (0–9), the hex system uses 6 additional symbols, represented by the first six letters of the alphabet.
Hex numbers use only 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F.
Here’s what the letters mean:
Each character represents a decimal value. For example, the letter B equals 11 in decimal and 1011 in binary.
Hex numbers can be converted into other number systems like binary (base-2), octal (base-8), or decimal (base-10).
Hex is widely used in computing because it provides a more readable way to represent binary values. One byte is 8 bits, and hex allows this data to be expressed more compactly and clearly.
What Is the Decimal System?
The decimal system is one of the oldest and most commonly used number systems today. It’s base-10, meaning it uses 10 different digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
This is the system we use in everyday life. Each position in a decimal number represents a power of 10.
Example:
The decimal value 11 is written as B in hex and 1011 in binary.
How to Convert from Hex to Decimal
As mentioned, the hex system includes 16 symbols, which are 0–9 and A–F.
To convert a hex number into decimal means to translate it from base-16 to base-10.
This is important in computing, especially in low-level programming and hardware interfaces. Memory addresses and machine code instructions are often written in hex, so converting them to decimal makes them easier to read and analyze.
Each letter in hex has a corresponding decimal value:
|
Hex base 16 |
Decimal base 10 |
Calculation |
|
0 |
0 |
- |
|
1 |
1 |
- |
|
2 |
2 |
- |
|
3 |
3 |
- |
|
4 |
4 |
- |
|
5 |
5 |
- |
|
6 |
6 |
- |
|
7 |
7 |
- |
|
8 |
8 |
- |
|
9 |
9 |
- |
|
A |
10 |
- |
|
B |
11 |
- |
|
C |
12 |
- |
|
D |
13 |
- |
|
E |
14 |
- |
|
F |
15 |
- |
|
10 |
16 |
1×161+0×160 = 16 |
|
11 |
17 |
1×161+1×160 = 17 |
|
12 |
18 |
1×161+2×160 = 18 |
|
13 |
19 |
1×161+3×160 = 19 |
|
14 |
20 |
1×161+4×160 = 20 |
|
15 |
21 |
1×161+5×160 = 21 |
|
16 |
22 |
1×161+6×160 = 22 |
|
17 |
23 |
1×161+7×160 = 23 |
|
18 |
24 |
1×161+8×160 = 24 |
|
19 |
25 |
1×161+9×160 = 25 |
|
1A |
26 |
1×161+10×160 = 26 |
|
1B |
27 |
1×161+11×160 = 27 |
|
1C |
28 |
1×161+12×160 = 28 |
|
1D |
29 |
1×161+13×160 = 29 |
|
1E |
30 |
1×161+14×160 = 30 |
|
1F |
31 |
1×161+15×160 = 31 |
|
20 |
32 |
2×161+0×160 = 32 |
|
30 |
48 |
3×161+0×160 = 48 |
|
40 |
64 |
4×161+0×160 = 64 |
|
50 |
80 |
5×161+0×160 = 80 |
|
60 |
96 |
6×161+0×160 = 96 |
|
70 |
112 |
7×161+0×160 = 112 |
|
80 |
128 |
8×161+0×160 = 128 |
|
90 |
144 |
9×161+0×160 = 144 |
|
A0 |
160 |
10×161+0×160 = 160 |
|
B0 |
176 |
11×161+0×160 = 176 |
|
C0 |
192 |
12×161+0×160 = 192 |
|
D0 |
208 |
13×161+0×160 = 208 |
|
E0 |
224 |
14×161+0×160 = 224 |
|
F0 |
240 |
15×161+0×160 = 240 |
|
100 |
256 |
1×162+0×161+0×160 = 256 |
|
200 |
512 |
2×162+0×161+0×160 = 512 |
|
300 |
768 |
3×162+0×161+0×160 = 768 |
|
400 |
1024 |
4×162+0×161+0×160 = 1024 |
To convert a hex number to decimal, multiply each digit by 16 raised to the power of its position (starting from 0 at the right).
Example:
Convert 1A to decimal:
You can do this for any hex number. But using free online tools is much easier and faster.
Hex to Decimal in Programming
Now that we’ve covered manual conversion, here’s how to convert hex to decimal using code in popular programming languages.
Python
Use the built-in int() function to convert a hex string to a decimal number:
You can also use hexadecimal literals directly:
JavaScript
Use the parseInt() function:
Hex constants can also be used directly:
The 16 digits used in the hex system are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
The hexadecimal number system is widely used in computer programming and system design.
First, remember that the hexadecimal system is base 16. That means it goes from 0 to 15, and numbers 10 to 15 are shown as letters:
10 = A
11 = B
12 = C
13 = D
14 = E
15 = F
Let’s say you want to convert 45.
Divide 45 by 16:
45 ÷ 16 = 2 remainder 13 → 2D
So, 45 in hexadecimal is 2D.
Here's a quick reference:
Hex Letter Decimal Value
A 10
B 11
C 12
D 13
E 14
F 15
This gets a bit technical. Computers usually use a method called two's complement to represent negative numbers.
For example: -1 in 8-bit hex is FF.
If you just want a quick idea, convert the positive part and treat the minus sign separately unless you're coding or working with memory.
Use a calculator or our free Hex to Decimal Converter to make it easy.
Let’s break it down:
20 ÷ 16 = 1 remainder 4
So: 1 × 16 + 4 = 20
This gives us: 20 (decimal) = 14 (hex)
Important: This “14” is hex, made up of digits 1 and 4. It’s not the same as decimal 14.
14 in decimal equals E in hexadecimal.
Simple as that: 14 (decimal) = E (hex)
The hexadecimal number system is a base-16 number system.
It uses exactly 16 unique digits or values.