Hex to Decimal
Convert hexadecimal to decimal instantly.
How to use this tool
- Enter hexadecimal in the fields above.
- Results update instantly as you type — or click Calculate.
- Read your decimal and the full breakdown beneath it.
Convert hexadecimal to decimal instantly.
Formula
Decimal = each hex digit × 16position, summed from right to left
decimal = parseInt(hex, 16)
Hex digits A–F represent values 10–15. For example, ff = 15×161 + 15×160 = 240 + 15 = 255.
How it works
Map each hexadecimal character to its numeric value (0–9 stay as-is; A=10, B=11, C=12, D=13, E=14, F=15), then multiply each value by 16 raised to its zero-indexed position from the right, and sum all products. JavaScript's parseInt(value, 16) handles this internally for both uppercase and lowercase hex strings.
Common mistake: Forgetting that letters A–F are valid digits (not errors) and that they represent values 10–15 is a common source of confusion when performing conversions by hand.
Worked example
Convert hexadecimal ff to decimal
- Identify the hex digits: f = 15 (position 1), f = 15 (position 0).
- Calculate positional values: 15 × 16¹ = 240 and 15 × 16⁰ = 15.
- Sum: 240 + 15 = 255.
255 — hexadecimal ff equals decimal 255.
Common mistakes to avoid
- Forgetting that hex digits A-F represent 10-15, treating A as 1 instead of 10.
- Including a "0x" prefix or "#" (from CSS colors) in the input without stripping it first, causing a parse error.
- Mixing up the base: using powers of 10 instead of powers of 16 when expanding digits manually.
Key terms
- Hexadecimal (base-16)
- A number system using digits 0–9 and letters A–F (or a–f) to represent values 0 through 15 per digit.
- Nibble
- A 4-bit binary group; each nibble maps exactly to one hexadecimal digit, making hex compact notation for binary data.
- parseInt(value, radix)
- A JavaScript function that parses a string as an integer in the given base (radix). parseInt('ff', 16) returns 255.
- Positional notation
- A system where a digit's contribution to a number's value depends on its position — each position here is a power of 16.
Frequently asked questions
- What is hex FF in decimal?
- F x 16 + F = 15 x 16 + 15 = 255.
- Are hex letters case-sensitive?
- No — 0xFF and 0xff are the same value. Both uppercase and lowercase are standard.
- How is hex used in web colors?
- CSS colors like #FF5733 represent three hex pairs: red (FF=255), green (57=87), blue (33=51).