๐ข Hex to Decimal Converter with Positional Breakdown
By Shihab Mia ยท Updated 2026-07-10
A 0x or # prefix is optional. Upper or lower case is fine.
To convert hex to decimal, multiply each hex digit by 16 raised to its position from the right and add the results: 1A becomes 1x16 + 10x1 = 26. This converter does that instantly, accepts an optional 0x or # prefix in upper or lower case, and shows the full positional breakdown plus the binary and octal equivalents so you can check the math, not just trust it.
What is the Hex to Decimal Converter?
Hexadecimal, or base 16, is the number system programmers use to write byte values compactly. It has sixteen digits: 0 to 9 keep their usual values, then A stands for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. Decimal, the base 10 system everyone learns first, only has ten digits, so converting hex to decimal means translating those extra letter-digits and the base 16 place values into the base 10 form your calculator and everyday life use.
The method is positional expansion. Number the hex digits from right to left starting at zero. The rightmost digit sits in the 16^0 place (which equals 1), the next sits in the 16^1 place (16), then 16^2 (256), 16^3 (4096) and so on. To convert hex to decimal you multiply each digit's value by the place value above it and sum every product. For the hex value 1A, the A is worth 10 in the ones place (10x1 = 10) and the 1 is worth 1 in the sixteens place (1x16 = 16), so 16 + 10 = 26. That is exactly what parseInt('1A', 16) returns, and it is the calculation this tool performs and then lays out row by row.
Under the hood every hex to decimal conversion here uses the browser's built in parseInt with a radix of 16, which is fast and exact for whole numbers up to 2^53. Because the result is a normal integer, the same value is trivially re-expressed in other bases, so the converter also reports the binary (base 2) and octal (base 8) forms. This is handy when you are reading a color code, a memory address, a permission mask or a Unicode code point and need to move between the representations without a second tool.
Hex to decimal conversion turns up far more often than most people expect. Web colors such as #FF0000 are three hex byte pairs, HTTP and assembly dumps list addresses in hex, MAC addresses and UUIDs are hex, and character encodings map code points like U+1F600 that you frequently need as a plain decimal number. Being able to convert hex to decimal quickly, and to see the arithmetic behind the answer, makes all of those tasks less error prone.
When to use it
- Turning a hex color channel like FF or 80 into its 0 to 255 decimal value when tweaking CSS or design tokens.
- Reading memory addresses, offsets or register values from a debugger or assembly dump as ordinary decimal numbers.
- Converting a Unicode code point written in hex (for example 1F600) into the decimal code point used by some APIs.
- Checking a students homework or a textbook exercise by seeing the full 16^n positional breakdown, not just the final answer.
How to use the Hex to Decimal Converter
- Type or paste your hexadecimal value into the box (a leading 0x or # prefix is optional).
- Read the decimal result at the top; it updates as you type, so no button press is needed.
- Scan the positional breakdown and table to see how each digit contributes via its 16^n place value.
- Copy the decimal, binary or octal output with the Copy buttons if you need it elsewhere.
Formula & method
Worked examples
Convert the hex value 1A to decimal.
- Number the digits from the right: A is position 0, 1 is position 1.
- Digit A has value 10, in the 16^0 (ones) place: 10 x 1 = 10.
- Digit 1 has value 1, in the 16^1 (sixteens) place: 1 x 16 = 16.
- Add the contributions: 16 + 10.
Result: 1A (hex) = 26 (decimal)
Convert the hex color channel FF to decimal.
- Both digits are F, which has value 15.
- Rightmost F is in the 16^0 place: 15 x 1 = 15.
- Left F is in the 16^1 place: 15 x 16 = 240.
- Add them: 240 + 15.
Result: FF (hex) = 255 (decimal), the maximum for one color channel
Hex digit to decimal value
| Hex digit | Decimal value |
|---|---|
| 0 to 9 | 0 to 9 (same) |
| A | 10 |
| B | 11 |
| C | 12 |
| D | 13 |
| E | 14 |
| F | 15 |
Common hex values and their decimal equivalents
| Hex | Decimal | Where you see it |
|---|---|---|
| A | 10 | Single letter-digit |
| 0F | 15 | Low nibble mask |
| 10 | 16 | One full place shift |
| 1A | 26 | Classic teaching example |
| 64 | 100 | Round decimal in hex |
| FF | 255 | Max single byte / color channel |
| 100 | 256 | One byte overflow point |
| 3E8 | 1000 | One thousand in hex |
Common mistakes to avoid
- Reading letter-digits as their alphabet position. In hex, A is 10 and F is 15, not 1 or 6. A is the eleventh symbol counting from 0, so its value is 10. Mixing up the letter with its place in the alphabet is the most frequent hex to decimal error.
- Counting positions from the left. Place values are counted from the right, starting at position 0. The rightmost digit is always the ones (16^0) place. Numbering from the left gives every digit the wrong power of 16.
- Forgetting to strip or account for the 0x prefix. Notations like 0x1A and #1A carry a prefix that marks the value as hex; it is not part of the number. This tool removes 0x and # automatically, but by hand you must convert only the digits after it.
- Treating hex like base 10 place values. Each hex place is worth 16 times the one to its right (1, 16, 256, 4096), not 10 times (1, 10, 100). Using powers of 10 instead of powers of 16 produces a wildly wrong decimal result.
Glossary
- Hexadecimal
- Base 16 number system using digits 0 to 9 and letters A to F, where A is 10 and F is 15.
- Decimal
- The everyday base 10 number system, using only the digits 0 to 9.
- Positional expansion
- Writing a number as the sum of each digit times its place value, the core method for hex to decimal conversion.
- Place value
- The weight of a digit based on its position; in hex the places are powers of 16 (1, 16, 256, 4096).
- Nibble
- A group of four bits, exactly one hexadecimal digit, holding a value from 0 to 15.
- 0x prefix
- A marker (0x, or # for colors) placed before hex digits to signal the value is hexadecimal, not part of the number itself.
Frequently asked questions
How do you convert hex to decimal?
Convert hex to decimal by multiplying each hex digit by 16 raised to its position (counting from 0 on the right) and adding the products. For 1A that is 1x16 + 10x1 = 16 + 10 = 26. Letter-digits use A=10, B=11, C=12, D=13, E=14 and F=15.
What is 1A in decimal?
1A in hex equals 26 in decimal. The A is worth 10 in the ones place (10x1) and the 1 is worth 16 in the sixteens place (1x16), and 16 + 10 = 26.
What is FF in decimal?
FF in hex equals 255 in decimal, because F is 15 and FF = 15x16 + 15x1 = 240 + 15. That is why 255 is the maximum value of one color channel or one byte, ranging 0 to 255.
Does this converter accept the 0x or # prefix?
Yes. You can enter 1A, 0x1A or #1A and the tool strips the 0x or # prefix automatically before converting, in upper or lower case. The prefix only labels the value as hexadecimal and is not part of the number.
Why do the letters A to F appear in hexadecimal?
The letters A to F exist because base 16 needs sixteen single-character digits but the decimal system only supplies ten (0 to 9). A through F fill the gap, standing for the decimal values 10 through 15 so each hex digit stays a single character.
Is there a limit to how large a hex value I can convert?
This converter is exact for whole numbers up to 2 to the power of 53, the safe integer limit in JavaScript, which covers hex strings up to about 13 digits. Beyond that it warns you rather than returning a rounded, imprecise result.