Hex to Decimal
Paste hex, get decimal — with the signed and unsigned readings shown separately, because FFFFFFFF is both 4,294,967,295 and −1 depending on the width it came from.
Runs 100% in your browser•Nothing is uploaded to a server•Free forever
Hexadecimal
Decimal
How hex becomes decimal
Hexadecimal is base 16, so each column is worth sixteen times the one to its right: 1, 16, 256, 4096, and so on. The digits run 0–9 then A–F, where A is ten and F is fifteen. To convert by hand you multiply each digit by its column value and add: 2F is (2 × 16) + 15 = 47, and 1A2B is (1 × 4096) + (10 × 256) + (2 × 16) + 11 = 6699. The converter above does the same arithmetic in BigInt, so it keeps working at lengths where doing it by hand stops being reasonable.
Most hex you meet in a day is a byte or a small run of them. A colour like #3CE688 is three bytes — red 60, green 230, blue 136. A permissions value, a status register, an opcode and a memory offset are all the same idea at different widths. The table below is the whole first byte, which covers the majority of hand conversions in one glance.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0_ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 1_ | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 2_ | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
| 3_ | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
| 4_ | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
| 5_ | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
| 6_ | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
| 7_ | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
| 8_ | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
| 9_ | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 |
| A_ | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
| B_ | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 |
| C_ | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 |
| D_ | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 |
| E_ | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 |
| F_ | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 |
The case that trips people up
A hex value with the top bit set has two correct decimal answers, and which one you want depends on the type it came out of. FFFFFFFF is 4,294,967,295 read as unsigned and −1 read as a signed 32-bit integer. If the number came from a C int, a Java int, a Go int32 or a register dump, the signed reading is almost certainly the one you want. Set the width above and tick signed and you get both, side by side, rather than having to guess which convention the tool picked for you.
The same is true of a value like 80000000: unsigned it is 2,147,483,648, signed it is −2,147,483,648, and a converter that only ever prints one of them is wrong for half the people who paste it in.
Where you keep meeting hex
Memory addresses and pointer values in a debugger or a crash log; CSS and design-token colours; the error codes Windows prints as 0x80070005; file magic numbers such as the 89 50 4E 47 that starts every PNG; MAC addresses; and every hash digest you will ever compare. In every one of those cases the hex is the canonical form and the decimal is what you want for a moment, to check a range or a size.
Going the other way, or want a bit pattern instead of a decimal? Try decimal to hex, hex to binary, or the full base converter with all bases at once.
More developer tools
- JSON Formatter
- Base64 Encode / Decode
- URL Encoder / Decoder
- Unix Timestamp Converter
- Regex Tester
- UUID Generator (v4 / v7)
- Hash Generator (MD5 / SHA / HMAC)
- JWT Decoder
- Password Generator
- JSON ⇄ CSV Converter
- HTML Entity Encoder / Decoder
- Cron Expression Explainer
- Color Converter
- WCAG Contrast Checker
- All tools on one page (home)