Edit either field and the other follows. Upper or lower case, a 0x or # prefix, spaces, underscores and colon or hyphen separators (as in a MAC address) are accepted. Whole numbers only.
Hex to decimal chart (00 to FF)
Find the first hex digit down the left side and the second digit across the top; the cell is the decimal value. For example, row Dx, column 6 gives D6 = 214. On a phone, swipe the grid sideways.
| Hex | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0x | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 1x | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
| 2x | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
| 3x | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
| 4x | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
| 5x | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 |
| 6x | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 |
| 7x | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 |
| 8x | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 |
| 9x | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 |
| Ax | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 |
| Bx | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 |
| Cx | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 |
| Dx | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 |
| Ex | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 |
| Fx | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 |
Notable hex values
| Hex | Decimal | Why it matters |
|---|---|---|
7F | 127 | largest signed 8-bit value |
80 | 128 | smallest signed 8-bit value when read as signed (−128) |
FF | 255 | largest unsigned byte |
100 | 256 | 162, one more than a byte holds |
3FF | 1,023 | ten bits all set |
FFF | 4,095 | 163 − 1 |
1000 | 4,096 | 163 |
7FFF | 32,767 | largest signed 16-bit value |
FFFF | 65,535 | largest unsigned 16-bit value |
10000 | 65,536 | 164 |
FFFFFF | 16,777,215 | white as a 24-bit RGB color |
10FFFF | 1,114,111 | highest Unicode code point |
7FFFFFFF | 2,147,483,647 | largest signed 32-bit value |
FFFFFFFF | 4,294,967,295 | largest unsigned 32-bit value |
Source: thealltools.com/tools/hex-to-decimal
About this tool
Paste a hex value and get its decimal equivalent, or type a decimal number and get hex back. Next to the two fields, the tool lists the binary bits in groups of four, reads the value as a signed integer of the width you choose, splits it into bytes in both big-endian and little-endian order, and writes out the arithmetic. It works on whole numbers of any length thanks to JavaScript BigInt, so 64-bit hashes and long IDs convert without rounding. Need to turn a string of text into hex byte codes instead? That is what the Text to Binary and Hex converter does. This page treats the input as one number.
How to convert hex to decimal here
- Enter the hex value in the Hexadecimal field.
0x1F,1f,#1Fand1Fall mean the same number. - The decimal result appears straight away. Type in the Decimal field to go the other way.
- Choose 8, 16, 32 or 64 bits to match the variable or register you are reading. The box below shows the signed value and the byte order for that width.
- Use the step-by-step box to check your own hand calculation.
Why one hex digit equals four bits
Hexadecimal is base 16, and 16 = 24. Four bits have exactly 16 possible patterns, from 0000 to 1111, and hex has exactly 16 digits, 0 to 9 then A (10) to F (15). So every hex digit maps to one fixed group of four bits with no carrying between groups, and a byte (eight bits) is always two hex digits. That is the whole reason hex is so common in computing: it is a compact way to write binary that you can still convert in your head. The default value shows it: FF9C is 1111 1111 1001 1100, one group per digit.
Worked example: FF9C to decimal
Each place in a hex number is worth a power of 16, counting from 0 on the right. Multiply each digit’s value by its place and add:
| Digit | Value | Place | Product |
|---|---|---|---|
F | 15 | 163 = 4,096 | 61,440 |
F | 15 | 162 = 256 | 3,840 |
9 | 9 | 161 = 16 | 144 |
C | 12 | 160 = 1 | 12 |
The sum is 61,440 + 3,840 + 144 + 12 = 65,436. Going back from decimal to hex, divide by 16 and keep the remainders: 65,436 ÷ 16 = 4,089 remainder 12 (C); 4,089 ÷ 16 = 255 remainder 9 (9); 255 ÷ 16 = 15 remainder 15 (F); 15 ÷ 16 = 0 remainder 15 (F). Reading the remainders from last to first spells FF9C.
If those two bytes hold a signed 16-bit integer, the answer is different. A 16-bit pattern whose top bit is set stands for its unsigned value minus 65,536, so FF9C read as signed is 65,436 − 65,536 = -100. The same bits, two meanings: the program reading them decides which, so pick the width that matches your data type.
Where you meet hex numbers
- Web colors.
#FF8800is three bytes: red FF = 255, green 88 = 136, blue 00 = 0. The three-digit form doubles each digit, so#F80is the same color. Converting the whole string to one number (16,746,496) is rarely what you want for a color; the Color Converter gives RGB and HSL. - Memory addresses and debugging. Debuggers, crash logs and hex dumps print addresses and raw bytes in hex. A 32-bit value tops out at
FFFFFFFF= 4,294,967,295. - Unicode code points. Characters are numbered with U+ and hex digits: U+00E9 (é) is 233 and U+1F600, the grinning face emoji, is 128,512. The last code point, U+10FFFF, is 1,114,111.
- MAC addresses. A network card’s EUI-48 address is six bytes written as hex pairs, such as
AC-DE-48-23-45-67. Paste it here, hyphens and all, to see it as the single 48-bit number 190,070,692,988,263. - Hashes and IDs. Output from the Hash Generator and the digits of a UUID are hex.
Byte order
Byte order only matters once a number is stored in memory or a file as several bytes. Big-endian puts the most significant byte first, so the 16-bit value FF9C is stored as FF 9C. Little-endian, the order x86 processors use, stores the same value as 9C FF. If a hex dump shows 9C FF and you convert it as written, you get 40,191 instead of 65,436. Reverse the byte pairs (not the single digits) first.
Common mistakes
- Reading hex 10 as ten.
0x10is 16. Likewise0x100is 256. - Mixing up the letter O with zero, or I with 1. Hex digits stop at F, so G to Z are never valid.
- Reversing digits instead of bytes. Swapping byte order turns
12 34into34 12, not43 21. - Calling a value negative without a width.
FFis −1 only as a signed 8-bit value; as a 16-bit value it is 255. - Expanding the three-digit color form as a number.
#F80is 3,968 as an integer, but the color it names is#FF8800.
Sources: MDN on CSS hex colors, the Unicode UTF and BOM FAQ for the code point range, and the IEEE EUI guidelines for MAC address notation.
Frequently asked questions
FF is 255. F is 15, so FF = 15 × 16 + 15 = 255, the largest value one byte can hold. Read as a signed 8-bit integer the same bits mean -1. In a web color, FF is a channel at full strength, which is why #FFFFFF is white.
Divide the number by 16 and note the remainder, then keep dividing each quotient by 16 until it reaches 0. Write each remainder as a hex digit (10 is A, up to 15 is F) and read them in reverse order. For 300: 300 ÷ 16 = 18 r 12 (C), 18 ÷ 16 = 1 r 2, 1 ÷ 16 = 0 r 1, so 300 = 12C.
The 0x prefix marks a number as hexadecimal in C, C++, Java, JavaScript, Python and many other languages, so 0x10 is read as 16 rather than ten. It is only a label: the digits after it are the actual value. Other notations you may meet are a trailing h, as in 1Fh, and the # sign used for colors.
It varies, because 16 is not a power of 10. Each hex digit carries four bits, about 1.2 decimal digits, so decimal versions run a little longer. Two hex digits reach 255 (three decimal digits), eight hex digits reach 4,294,967,295 (ten digits), and sixteen hex digits reach 18,446,744,073,709,551,615 (twenty digits).
Yes. Written with a minus sign, -1A is simply -26. In computer memory there is no minus sign, so negative integers are stored in two's complement: -26 as a 16-bit value is FFE6, because 65,536 - 26 = 65,510 = FFE6. Type -26 in the decimal field to see the pattern for any width.
Yes. Hexadecimal, hex and base 16 all name the same number system with sixteen digits, 0 to 9 and A to F. The letters can be upper or lower case; ff and FF are equal. Base 16 is popular because it lines up exactly with bytes, two digits per byte, unlike base 10.