The simplest explanation of hexadecimal is this:
In "decimal" we have ten digits, 0 through 9. In "hexadecimal" we have sixteen digits, 0 through F. That is literally all there is to it. Everything else works exactly the same!
A point of clarification before the example. To differentiate between decimal and hexadecimal numbers, an "h" is appended to hexadecimal numbers. Hexadecimal is quite a jaw-breaker to repeat, so it is often simply called "hex".
Another point of interest is that hex numbers are usually presented as two digits, since one "byte" can have a hex value between 00h and FFh (0 through 255 decimal).
When counting in decimal, once we run out of digits we start combining them by putting a 1 to the left and starting at 0 on the right; thus 10 follows 9. In the same way, in hex once we run out of digits we do the same, thus 10h follows Fh.
Decimal : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 etc. Hex: 0h 1h 2h 3h 4h 5h 6h 7h 8h 9h Ah Bh Ch Dh Eh Fh 10h 11h etc.
Note that 10h is not said aloud as "ten" because it is not ten, it is sixteen! Generally hex numbers are said as the individual digits; thus 10h is "one zero hex".
To convert between decimal and hex is quite simple with the following chart:
0h | 1h | 2h | 3h | 4h | 5h | 6h | 7h | 8h | 9h | Ah | Bh | Ch | Dh | Eh | Fh | |
0h | 0 | 16 | 32 | 48 | 64 | 80 | 96 | 112 | 128 | 144 | 160 | 176 | 192 | 208 | 224 | 240 |
1h | 1 | 17 | 33 | 49 | 65 | 81 | 97 | 113 | 129 | 145 | 161 | 177 | 193 | 209 | 225 | 241 |
2h | 2 | 18 | 34 | 50 | 66 | 82 | 98 | 114 | 130 | 146 | 162 | 178 | 194 | 210 | 226 | 242 |
3h | 3 | 19 | 35 | 51 | 67 | 83 | 99 | 115 | 131 | 147 | 163 | 179 | 195 | 211 | 227 | 243 |
4h | 4 | 20 | 36 | 52 | 68 | 84 | 100 | 116 | 132 | 148 | 164 | 180 | 196 | 212 | 228 | 244 |
5h | 5 | 21 | 37 | 53 | 69 | 85 | 101 | 117 | 133 | 149 | 165 | 181 | 197 | 213 | 229 | 245 |
6h | 6 | 22 | 38 | 54 | 70 | 86 | 102 | 118 | 134 | 150 | 166 | 182 | 198 | 214 | 230 | 246 |
7h | 7 | 23 | 39 | 55 | 71 | 87 | 103 | 119 | 135 | 151 | 167 | 183 | 199 | 215 | 231 | 247 |
8h | 8 | 24 | 40 | 56 | 72 | 88 | 104 | 120 | 136 | 152 | 168 | 184 | 200 | 216 | 232 | 248 |
9h | 9 | 25 | 41 | 57 | 73 | 89 | 105 | 121 | 137 | 153 | 169 | 185 | 201 | 217 | 233 | 249 |
Ah | 10 | 26 | 42 | 58 | 74 | 90 | 106 | 122 | 138 | 154 | 170 | 186 | 202 | 218 | 234 | 250 |
Bh | 11 | 27 | 43 | 59 | 75 | 91 | 107 | 123 | 139 | 155 | 171 | 187 | 203 | 219 | 235 | 251 |
Ch | 12 | 28 | 44 | 60 | 76 | 92 | 108 | 124 | 140 | 156 | 172 | 188 | 204 | 220 | 236 | 252 |
Dh | 13 | 29 | 45 | 61 | 77 | 93 | 109 | 125 | 141 | 157 | 173 | 189 | 205 | 221 | 237 | 253 |
Eh | 14 | 30 | 46 | 62 | 78 | 94 | 110 | 126 | 142 | 158 | 174 | 190 | 206 | 222 | 238 | 254 |
Fh | 15 | 31 | 47 | 63 | 79 | 95 | 111 | 127 | 143 | 159 | 175 | 191 | 207 | 223 | 239 | 255 |
Find the decimal number you want to convert and look at the top hex digit first then at the left hex digit and you have the hex equivalent!
Do the reverse to convert from hex to decimal, find the left hex digit on the top position and find the right hex digit along the left side; where the two meet is the decimal equivalent!
The more you work with hex the easier it will become.
If you know for a fact that I have made any mistakes above, please let me know.
Feed back on clarity and semantics will also be greatly appreciated.
Thanks, Eddie Lotter