Hex to Decimal Converter
Convert hexadecimal numbers to decimal.
Reading a hex number one digit at a time
Each hex digit is worth 16 times the digit to its right. To convert by hand, turn every digit into its value (A is 10, B is 11, up to F at 15), multiply it by its place value and add the results. Here is 1A3F, which the converter shows as 6719:
| Digit | Value | Place value | Product |
|---|---|---|---|
| 1 | 1 | 16³ = 4096 | 4096 |
| A | 10 | 16² = 256 | 2560 |
| 3 | 3 | 16¹ = 16 | 48 |
| F | 15 | 16⁰ = 1 | 15 |
4096 + 2560 + 48 + 15 = 6719. The panel under the result also gives the same value in binary (1101000111111) and octal (15077), so you can read any base without a second conversion.
Where you run into hex that needs a decimal value
- Colour channels. In
#C0FFEE, the pairs C0, FF and EE are 192, 255 and 238. For whole colour codes, the HEX to RGB converter splits the pairs for you. - Character codes. Unicode writes code points in hex. U+00E9 (é) is code 233.
- Limits and sentinel values.
7FFFFFFFis 2147483647, the largest signed 32-bit integer.DEADBEEF, a common filler value in memory dumps, is 3735928559. - Offsets in a hex dump. An offset of 1F4 is byte 500.
What the input box accepts, and what it quietly ignores
Letters can be upper or lower case. Spaces are stripped out, so FF FF is read as FFFF (65535). A 0x prefix works: 0x1F gives 31.
A # in front is not accepted and gives an error, so drop it when you paste a colour code. A trailing h, as in assembly listings, is ignored: FFh gives 255.
Be careful with typos. Reading stops at the first character that isn't a hex digit, and the rest is dropped without a warning. 1G returns 1, not an error. If a result looks too small, check the input for a stray letter after F or a letter O typed instead of a zero.
Signed values and very long hex strings
The converter reads hex as an unsigned number. FFFFFFFF comes out as 4294967295. If that value is a signed 32-bit integer from a program or a register, and its first digit is 8 or higher, subtract 4294967296 to get the signed value: 4294967295 − 4294967296 = −1. A minus sign in the input is kept as it is: -1A gives −26.
Results are exact up to 1FFFFFFFFFFFFF (9007199254740991). Longer values are rounded. FFFFFFFFFFFFFFFF shows as 18446744073709552000, while the true value is 18446744073709551615. For 64-bit hashes or IDs, treat the last few decimal digits as unreliable.
Frequently asked questions
Does it matter if I type FF or ff?+
No. Hex digits are not case sensitive, so FF, ff and Ff are all 255. The hexadecimal box in the results panel always shows capital letters.
Why does hex 10 equal 16 and not 10?+
In hex the second position from the right counts sixteens, not tens. 10 in hex means one sixteen and zero ones, which is 16 in decimal. The value the page opens with, 42, is four sixteens plus two, so it shows 66.
Can I convert several hex values at once?+
No. Spaces are removed before conversion, so typing 1A 2B is read as the single number 1A2B, which is 6699. Convert one value at a time.
How do I convert the result back to hex?+
Use the Decimal to Hex converter, which runs the same conversion in the other direction and also shows binary and octal.
Embed this tool on your website
Free to use on blogs, school sites and intranets. Paste this code into your page's HTML; please keep the credit line.
<iframe src="https://utilityapp.lat/embed/convert/hex-to-decimal" title="Hex to Decimal Converter" width="100%" height="420" style="border:0;max-width:760px" loading="lazy"></iframe> <p style="font-size:13px"><a href="https://utilityapp.lat/convert/hex-to-decimal">Hex to Decimal Converter</a> by UtilityApp</p>