Free tool
Hex to decimal converter
To turn hex into decimal, multiply each hex digit by 16 to the power of its position and add them up: 0xFF = 15×16 + 15 = 255. Type any hex value below to get the decimal number, the working, and what the same bits mean as a signed integer.
Free · no sign-up · runs in your browser, nothing is uploaded
2,014
4 digits
Binary (2)
111 1101 1110
Octal (8)
3736
Decimal (10)
2,014
Hex (16)
7DE
- 16-bit pattern
- 0000 0111 1101 1110
- hex
- 0x07DE
- bytes, big-endian
- 07 DE
- bytes, little-endian
- DE 07
- as unsigned
- 2014
- as signed
- 2014
Click a bit to flip it. The numbers under each byte are bit positions (0 is the lowest bit).
Multiply each digit by its place value (16 to the power of its position, counting from 0 at the right of the point), then add them up.
| digit | value | place | digit × place |
|---|---|---|---|
| 7 | 7 | 16^2 = 256 | 1792 |
| D | 13 | 16^1 = 16 | 208 |
| E | 14 | 16^0 = 1 | 14 |
1792 + 208 + 14 = 2014
Result: 2014 (decimal)
How to convert hex to decimal, step by step
Hexadecimal is base 16. Its digits run from 0 to F, and each place is worth 16 times the place to its right: 1, 16, 256, 4,096, 65,536 and so on.
| Hex digit | Value |
|---|---|
| 0-9 | 0-9 |
| A | 10 |
| B | 11 |
| C | 12 |
| D | 13 |
| E | 14 |
| F | 15 |
Worked example, 0x1A3F:
1 × 16³ = 1 × 4096 = 4096
A × 16² = 10 × 256 = 2560
3 × 16¹ = 3 × 16 = 48
F × 16⁰ = 15 × 1 = 15
------
6719Upper and lower case mean the same thing: ff, FF and 0xFf are all 255. Hex fractions work the same way with negative powers: 0x0.8 is 8/16 = 0.5.
Hex values you see in code
| Hex | Unsigned decimal | Signed (same width) |
|---|---|---|
| 7F | 127 | 127 (8-bit max) |
| 80 | 128 | -128 (8-bit) |
| FF | 255 | -1 (8-bit) |
| 100 | 256 | 256 |
| FFFF | 65,535 | -1 (16-bit) |
| 7FFFFFFF | 2,147,483,647 | 2,147,483,647 (32-bit max) |
| 80000000 | 2,147,483,648 | -2,147,483,648 (32-bit min) |
| FFFFFFFF | 4,294,967,295 | -1 (32-bit) |
| FFFFFFFFFFFFFFFF | 18,446,744,073,709,551,615 | -1 (64-bit) |
Whether FFFFFFFF is 4,294,967,295 or -1 depends on the type that holds it, not on the bits. Pick a width in the converter’s bits panel to see both readings.
Signed hex: when FF means -1
In a signed integer type the highest bit is the sign bit (two’s complement). For a hex value of a known width, if the first digit is 8 or higher the number is negative, and its value is the unsigned value minus 2 to the power of the width. FFFFFF85 as a 32-bit signed int is 4,294,967,173 - 4,294,967,296 = -123.
// JavaScript: read 32-bit hex as signed
BigInt.asIntN(32, 0xFFFFFF85n) // -123n
0xFFFFFF85 | 0 // -123 (bitwise ops use 32-bit ints)
# Python
v = int('FFFFFF85', 16)
v - (1 << 32) if v >= 1 << 31 else v # -123Hex to decimal in code
// JavaScript
parseInt('7DE', 16) // 2014
Number('0x7DE') // 2014 (needs the 0x prefix)
BigInt('0x' + 'FFFFFFFFFFFFFFFF') // 18446744073709551615n, exact
# Python
int('7DE', 16) # 2014
int('0x7de', 0) # 2014, base from the prefix
// Go
n, err := strconv.ParseInt("7DE", 16, 64) // 2014
u, err := strconv.ParseUint("FFFFFFFFFFFFFFFF", 16, 64)
# Bash
echo $((16#7DE)) # 2014
echo "ibase=16; 7DE" | bc # 2014 (bc needs uppercase hex)JavaScript numbers are exact only up to 2^53 - 1, which is 1FFFFFFFFFFFFF in hex (14 digits). Beyond that, parseInt rounds; BigInt does not. This converter uses BigInt, so 64-bit hashes and IDs convert exactly.
Hex to decimal table, 00 to FF
Find the first hex digit on the left and the second along the top. 0xA5 is row A, column 5: 165. For the same values in binary see the decimal to binary table; for colors written in hex, the hex to RGB converter.
| hex | _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 |
More free developer tools
FAQ
How do you convert hex to decimal?+
Number the digits from the right starting at 0, turn each digit into its value (A=10, B=11, C=12, D=13, E=14, F=15), multiply it by 16 to the power of its position, and add the results. 7DE is 7×256 + 13×16 + 14×1 = 2014.
What is FF in decimal?+
255: F×16 + F = 15×16 + 15. FF is the largest value of one byte. As a signed 8-bit number it means -1, because the top bit is set.
What does 0x mean in front of a number?+
It marks the number as hexadecimal in C, JavaScript, Python, Go, Rust and most other languages. 0x10 is 16, not 10. The converter accepts the prefix, and if you type 0x while Decimal is selected it reads the number as hex and tells you.
What is 7F in decimal?+
127, the largest value of a signed byte. 80 is 128 (or -128 signed), FFFF is 65,535, 7FFFFFFF is 2,147,483,647 (the largest signed 32-bit integer) and FFFFFFFF is 4,294,967,295.
How do I convert hex to decimal in Excel?+
Use =HEX2DEC("A5"), which returns 165. Excel takes at most 10 hex characters (40 bits) and treats the top bit as the sign, so =HEX2DEC("FFFFFFFF5B") is -165. For longer values, use a script or this converter.
Why do programmers use hexadecimal?+
One hex digit is exactly 4 bits, so every byte is two hex digits and long bit patterns become short and readable. Memory addresses, colors (#FF8800), byte dumps, hashes and Unicode code points (U+00E9) are all written in hex.
How do I convert decimal back to hex?+
Divide by 16 and keep the remainders: 2014 ÷ 16 = 125 r 14 (E), 125 ÷ 16 = 7 r 13 (D), 7 ÷ 16 = 0 r 7. Read the remainders bottom up: 7DE. Press swap above to convert in that direction with the steps shown.
Sources: MDN: parseInt() · MDN: BigInt · MDN: BigInt.asIntN() · Python: int() · Go: strconv.ParseInt · Microsoft: HEX2DEC function. Checked 2026-10-30.