Hex to Decimal Converter
To use hexadecimal to decimal converter, type any hex value e.g. "6C" and click on the Convert button and you will get the decimal value of "108" on right side. You can convert any value upto the range of 7FFFFFFFFFFFFFFF which is 16 hex characters.
Hex to Decimal Conversion:
- Hexadecimal Numeral System
- Decimal Numeral System
- How to Convert Hex to Decimal
- How to Convert Fractional Hex to Decimal
- Hex to Decimal Examples
- FAQs (Hex to Decimal Conversion)
- Hex to Decimal Table
Hexadecimal Numeral System (Hex Numbers)
Hexadecimal or hex numbers are a number system based on base 16, meaning they use 16 unique symbols to represent values. These symbols are:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F
Where:
0 to 9 represent values 0 to 9 (same as decimal).
A, B, C, D, E, F represent values 10, 11, 12, 13, 14, 15 respectively.
Example:
Every hex digit represents a power of 16, let's consider a hex value "3B89.1E"
Digit | Position | Power of 16 | Value |
---|---|---|---|
3 | 163 (4096's place) | 163 = 4096 | 3 × 4096 = 12288 |
B (11) | 162 (256's place) | 162 = 256 | 11 × 256 = 2816 |
8 | 161 (16's place) | 161 = 16 | 8 × 16 = 128 |
9 | 160 (1's place) | 160 = 1 | 9 × 1 = 9 |
1 | 16-1 (1/16's place) | 16-1 = 1/16 = 0.0625 | 1 × 0.0625 = 0.0625 |
E (14) | 16-2 (1/256's place) | 16-2 = 1/256 = 0.00390625 | 14 × 0.00390625 = 0.0546875 |
Decimal Result: 12288 + 2816 + 128 + 9 + 0.0625 + 0.0546875 = 15241.1171875
(3B89.1E)16 = (15241.1171875)10
Decimal Numeral System
A decimal number is any number represented using the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 in the base-10 positional system. Each position (or place) in the number has a value based on a power of 10. The decimal point (.) separates the whole number part from the fractional part.
Example:
Decimal value "1987.654" can be expressed as power of 10:
Digit | Position | Power of 10 | Value |
---|---|---|---|
1 | 103 (Thousands place) | 103 = 1000 | 1 × 1000 = 1000 |
9 | 102 (Hundreds place) | 102 = 100 | 9 × 100 = 900 |
8 | 101 (Tens place) | 101 = 10 | 8 × 10 = 80 |
7 | 100 (Ones place) | 100 = 1 | 7 × 1 = 7 |
6 | 10-1 (Tenths place) | 10-1 = 0.1 | 6 × 0.1 = 0.6 |
5 | 10-2 (Hundredths place) | 10-2 = 0.01 | 5 × 0.01 = 0.05 |
4 | 10-3 (Thousandths place) | 10-3 = 0.001 | 4 × 0.001 = 0.004 |
Total = (1 × 103) + (9 × 102) + (8 × 101) + (7 × 100) + (6 × 10-1) + (5 × 10-2) + (4 × 10-3) = 1000 + 900 + 80 + 7 + 0.6 + 0.05 + 0.004 = 1987.654
How to Convert Hex to Decimal
Hexadecimal numbers are the base-16 numbers and every hex digit can be represented as powers to the base-16. For example, every digit of the hex number "6AF" represent the power to the base-16.
Hex digit or nibble"F" is at 160 position.
Hex digit or nibble"A" is at 161 position.
Hex digit or nibble"6" is at 162 position.
Considering the above scenario any hex value can be converted to decimal by using three steps below. Hex digits (0 to F) represents the decimal values from (0 to 15).
Step-1: Split the hex number to nibbles (4-bits), convert every nibble or hex digit to a decimal value.
Step-2: Multiply every decimal value from hex nibble to the corresponding power to the base-16.
Step-3: Sum all the multipliers or products to get the final decimal value of hex number.
How to Convert Fractional Hex to Decimal
Follow the following steps to convert the fractional hex value to decimal:
Step-1: Get the fractional part from the hex number. For example fraction value from this hex number "4B.5C" is "5C".
Step-2: Convert the hex digits to their corresponding decimal values and multiply them with the increasing negative powers of 16. For example (5)16 = (5)10 and (C)16 = (12)10. 5 is multiplied by 16-1 and 12 is multiplied by 16-2.
Step-3: Sum all the products to the get the final fractional value in decimal.
Hex to Decimal Examples
Example 1: Convert the hex number "6AF" to the decimal value.
Nibble-1 | Nibble-2 | Nibble-3 |
---|---|---|
6 | A | F |
6 | 10 | 15 |
Position: 162 | 161 | 160 | |||||||||||||||
256 | 16 | 1 |
Multiply: 256 × 6 | 16 × 10 | 1 × 15 | |||||||||||||||
= 1536 | = 160 | = 15 |
Example 2: Convert the hex number "7D5E" to the decimal value.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 |
---|---|---|---|
7 | D | 5 | E |
7 | 13 | 5 | 14 |
163 | 162 | 161 | 160 |
---|---|---|---|
4096 | 256 | 16 | 1 |
7 × 4096 | 13 × 256 | 5 × 16 | 14 × 1 |
= 28672 | = 3328 | = 80 | = 14 |
Example 3: Convert the hex number "6E4D.C1" to the decimal value.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | Nibble-5 | Nibble-6 |
---|---|---|---|---|---|
6 | E | 4 | D | C | 1 |
6 | 14 | 4 | 13 | 12 | 1 |
163 | 162 | 161 | 160 | 16-1 | 16-2 |
---|---|---|---|---|---|
4096 | 256 | 16 | 1 | 1/16 | 1/256 |
6 × 4096 | 14 × 256 | 4 × 16 | 13 × 1 | 12 × 1/16 | 1 × 1/256 |
= 24576 | = 3584 | = 64 | = 13 | = 0.75 | = 0.00390625 |
Example 4: Convert the hex number "9AB4.EF" to the decimal value.
Nibble-1 | Nibble-2 | Nibble-3 | Nibble-4 | Nibble-5 | Nibble-6 |
---|---|---|---|---|---|
9 | A | B | 4 | E | F |
9 | 10 | 11 | 4 | 14 | 15 |
163 | 162 | 161 | 160 | 16-1 | 16-2 |
---|---|---|---|---|---|
4096 | 256 | 16 | 1 | 1/16 | 1/256 |
9 × 4096 | 10 × 256 | 11 × 16 | 4 × 1 | 14 × 1/16 | 15 × 1/256 |
= 36864 | = 2560 | = 176 | = 4 | = 0.875 | = 0.05859375 |
Frequently Ask Questions: Hex to Decimal Conversion
Q1: Convert hex value 0xFF9A to decimal assuming 16-bit 2’s complement?
0x notation is used to represent hexadecimal numbers.
Since F = 1111, 9 = 1001, A = 1010, (FF9A)16 = (1111111110011010)2
As MSB = 1, it is a negative number, take 2's complement:
Invert bits: 0000000001100101
Add 1: 0000000001100101 + 1 = (0000000001100110)2 = (102)10, for the detailed understanding please have a look at Binary to decimal converter.
As value is negative, final decimal value = -102
Q2: What is the result in decimal for the XOR of hex numbers 0x7F and 0xC3?
(7F)16 = (01111111)2 and (C3)16 = (11000011)2
When we perform XOR operation we check that whether two bits are different or same. If they are different then result is 1 and if they are same then the result is 0.
Bitwise XOR operation:
X = 01111111
Y = 11000011
-------------------------------------
X ⊕ Y (Bitwise XOR) = 10111100
1011 = B in hex and 1100 = C, Therefore, (10111100)2 = (BC)16
Since B = 11 in decimal and C is 12 in decimal, therefore Decimal value = (11 × 161) + (12 × 160) = 176 + 12 = (188)10
Q3: Conver the hex value 0x1A.8 to decimal with fractional part?
1A = (1 × 161) + (10 × 160) = (16 + 10) = 26
0.8 = (8 × 16-1) = 8/16 = 1/2 = 0.5
Therefore (1A.8)16 = (26.5)10
Q4: Add two hex numbers 0xA8 and 0x3D and provide the result in decimal?
Convert the hex numbers to decimal, (A8)16 = (168)10 and (3D)16 = (61)10
Final decimal value is 168 + 61 = 229
Q5: Mask the hex value 0xA with 0xF, right shift by 2 and convert the result to decimal?
By masking we mean bitwise AND operation, therefore masking result = 0xA & 0xF = 1010 & 1111 = 1010
While doing the right shift, 0s are padded on the left side: 1010 >> 2 = (0010)2 = (2)10
Final decimal value = 2
Q6: Convert unsigned hex number 0xABCDEF to decimal?
Since (A)16 = (10)10, (B)16 = (11)10, (C)16 = (12)10, (D)16 = (13)10, (E)16 = (14)10 and (F)16 = (15)10, Therefore:
(ABCDEF)16 = (10 × 165) + (11 × 164) + (12 × 163) + (13 × 162) + (14 × 161) + (15 × 160)
(ABCDEF)16 = (10 × 1048576) + (11 × 65536) + (12 × 4096) + (13 × 256) + (14 × 16) + (15 × 1)
(ABCDEF)16 = (10485760) + (720896) + (49152) + (3328) + (224) + (15)
(ABCDEF)16 = (11259375)10
Hex to Decimal Conversion Table
Hexadecimal | Decimal |
---|---|
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 |
11 | 17 |
12 | 18 |
13 | 19 |
14 | 20 |
15 | 21 |
16 | 22 |
17 | 23 |
18 | 24 |
19 | 25 |
1A | 26 |
1B | 27 |
1C | 28 |
1D | 29 |
1E | 30 |
1F | 31 |
20 | 32 |
21 | 33 |
22 | 34 |
23 | 35 |
24 | 36 |
25 | 37 |
26 | 38 |
27 | 39 |
28 | 40 |
29 | 41 |
2A | 42 |
2B | 43 |
2C | 44 |
2D | 45 |
2E | 46 |
2F | 47 |
30 | 48 |
31 | 49 |
32 | 50 |
33 | 51 |
34 | 52 |
35 | 53 |
36 | 54 |
37 | 55 |
38 | 56 |
39 | 57 |
3A | 58 |
3B | 59 |
3C | 60 |
3D | 61 |
3E | 62 |
3F | 63 |
40 | 64 |
Hexadecimal | Decimal |
---|---|
41 | 65 |
42 | 66 |
43 | 67 |
44 | 68 |
45 | 69 |
46 | 70 |
47 | 71 |
48 | 72 |
49 | 73 |
4A | 74 |
4B | 75 |
4C | 76 |
4D | 77 |
4E | 78 |
4F | 79 |
50 | 80 |
51 | 81 |
52 | 82 |
53 | 83 |
54 | 84 |
55 | 85 |
56 | 86 |
57 | 87 |
58 | 88 |
59 | 89 |
5A | 90 |
5B | 91 |
5C | 92 |
5D | 93 |
5E | 94 |
5F | 95 |
60 | 96 |
61 | 97 |
62 | 98 |
63 | 99 |
64 | 100 |
65 | 101 |
66 | 102 |
67 | 103 |
68 | 104 |
69 | 105 |
6A | 106 |
6B | 107 |
6C | 108 |
6D | 109 |
6E | 110 |
6F | 111 |
70 | 112 |
71 | 113 |
72 | 114 |
73 | 115 |
74 | 116 |
75 | 117 |
76 | 118 |
77 | 119 |
78 | 120 |
79 | 121 |
7A | 122 |
7B | 123 |
7C | 124 |
7D | 125 |
7E | 126 |
7F | 127 |
80 | 128 |
Hexadecimal | Decimal |
---|---|
81 | 129 |
82 | 130 |
83 | 131 |
84 | 132 |
85 | 133 |
86 | 134 |
87 | 135 |
88 | 136 |
89 | 137 |
8A | 138 |
8B | 139 |
8C | 140 |
8D | 141 |
8E | 142 |
8F | 143 |
90 | 144 |
91 | 145 |
92 | 146 |
93 | 147 |
94 | 148 |
95 | 149 |
96 | 150 |
97 | 151 |
98 | 152 |
99 | 153 |
9A | 154 |
9B | 155 |
9C | 156 |
9D | 157 |
9E | 158 |
9F | 159 |
A0 | 160 |
A1 | 161 |
A2 | 162 |
A3 | 163 |
A4 | 164 |
A5 | 165 |
A6 | 166 |
A7 | 167 |
A8 | 168 |
A9 | 169 |
AA | 170 |
AB | 171 |
AC | 172 |
AD | 173 |
AE | 174 |
AF | 175 |
B0 | 176 |
B1 | 177 |
B2 | 178 |
B3 | 179 |
B4 | 180 |
B5 | 181 |
B6 | 182 |
B7 | 183 |
B8 | 184 |
B9 | 185 |
BA | 186 |
BB | 187 |
BC | 188 |
BD | 189 |
BE | 190 |
BF | 191 |
C0 | 192 |
Hexadecimal | Decimal |
---|---|
C1 | 193 |
C2 | 194 |
C3 | 195 |
C4 | 196 |
C5 | 197 |
C6 | 198 |
C7 | 199 |
C8 | 200 |
C9 | 201 |
CA | 202 |
CB | 203 |
CC | 204 |
CD | 205 |
CE | 206 |
CF | 207 |
D0 | 208 |
D1 | 209 |
D2 | 210 |
D3 | 211 |
D4 | 212 |
D5 | 213 |
D6 | 214 |
D7 | 215 |
D8 | 216 |
D9 | 217 |
DA | 218 |
DB | 219 |
DC | 220 |
DD | 221 |
DE | 222 |
DF | 223 |
E0 | 224 |
E1 | 225 |
E2 | 226 |
E3 | 227 |
E4 | 228 |
E5 | 229 |
E6 | 230 |
E7 | 231 |
E8 | 232 |
E9 | 233 |
EA | 234 |
EB | 235 |
EC | 236 |
ED | 237 |
EE | 238 |
EF | 239 |
F0 | 240 |
F1 | 241 |
F2 | 242 |
F3 | 243 |
F4 | 244 |
F5 | 245 |
F6 | 246 |
F7 | 247 |
F8 | 248 |
F9 | 249 |
FA | 250 |
FB | 251 |
FC | 252 |
FD | 253 |
FE | 254 |
FF | 255 |
Related Conversions
Please find the related numeric conversions.