Hex to decimal conversion rewrites a base-16 number as its base-10 equivalent. Multiply each hexadecimal digit by the power of sixteen assigned to its position, then add the results. For example, 4B9 equals 4 × 256 + 11 × 16 + 9, which gives decimal 1,209.
The value stays the same; only its notation changes. This is useful when you need to understand an address offset, interpret a numeric field in a log, or check a calculation from a programming exercise.
Before converting, identify what the input represents. A plain unsigned integer, a fixed-width signed value, a hexadecimal fraction, and a sequence of bytes can require different handling. The steps below explain the basic calculation first, then show how to avoid incorrect signs, reversed bytes, partial parsing, and rounded results for large integers.
The Method in a Few Lines
To convert hexadecimal to decimal, replace A–F with values 10–15, multiply each digit by 16 raised to its position, and add. Count positions from zero at the rightmost whole-number digit. This gives the unsigned magnitude; a signed bit pattern needs its width and signed representation interpreted separately.
How to Convert Hex to Decimal by Hand
Hexadecimal uses sixteen digit values: 0–9, then A=10, B=11, C=12, D=13, E=14, and F=15. Uppercase and lowercase letter forms of these hexadecimal digits have equal numeric values.
Decimal uses powers of ten. Hexadecimal uses powers of 16, which give these whole-number position weights from right to left:
1, 16, 256, 4,096, 65,536, ...
For an unsigned whole number with n digits, the positional notation formula is:
N = d₀ × 16⁰ + d₁ × 16¹ + … + dₙ₋₁ × 16ⁿ⁻¹Here, N is the decimal equivalent, d₀ is the numeric value of the rightmost digit, and each increasing subscript moves one position left. The exponent starts at zero because 16⁰ equals one.
Do not include a 0x prefix in the digit count. It labels the number as hexadecimal in many programming contexts. It does not add two numeric positions. Other notations, such as a trailing h or a color-code hash sign, need explicit support from the parser you use.
This base 16 to base 10 method applies regardless of whether the number contains letters. The input 24, when labeled hexadecimal, equals decimal 36 rather than decimal 24.
Work Through 4B9 and Check the Answer
Start with the rightmost digit and assign each position its weight:
Digit | Numeric Value | Position | Weight | Contribution |
4 | 4 | 2 | 16² = 256 | 1,024 |
B | 11 | 1 | 16¹ = 16 | 176 |
9 | 9 | 0 | 16⁰ = 1 | 9 |
The sum is 1,024 + 176 + 9 = 1,209.
A useful magnitude check comes from the leftmost digit. Any three-digit hex number beginning with 4 lies from 400 through 4FF, or decimal 1,024 through 1,279. The answer 1,209 fits inside that interval.

An Alternative: Multiply the Running Total by 16
You can also evaluate the digits from left to right without writing a powers table. Start with zero, multiply the running total by sixteen, and add the next digit's value:
- Read
4: 0 × 16 + 4 = 4. - Read
B: 4 × 16 + 11 = 75. - Read
9: 75 × 16 + 9 = 1,209.
This multiply-and-add approach evaluates the same positional formula and is convenient for longer inputs.
For a reverse conversion check, divide 1,209 by sixteen. The successive remainders are 9, 11, and 4. Reading them in reverse gives 4B9. This verifies the digit order as well as the final total.
Keep a Small Conversion Table for Cross-Checks
These reference values cover digit boundaries, byte limits, and common powers of sixteen:
Hexadecimal | Decimal | What It Helps Check |
| 0 | Zero input |
| 10 | First letter digit |
| 15 | Largest single digit |
| 16 | First carry into a second position |
| 127 | Largest positive signed eight-bit value |
| 128 | Eight-bit sign threshold |
| 255 | Largest unsigned byte |
| 256 | First three-position value |
| 1,024 | A power-of-two boundary |
| 1,209 | The worked example |
| 65,535 | Largest unsigned sixteen-bit value |
The table assumes unsigned numeric interpretation unless the note explicitly describes a signed range. A limit such as FF = 255 does not establish what a protocol intends the byte to mean.
Use the table to check your method, rather than substituting memorized values for the place-value calculation. It is especially useful for spotting an exponent that started at one instead of zero.
Handle Signed Hexadecimal with a Defined Bit Width
A leading minus sign and a two's-complement bit pattern are different forms of signed hexadecimal.
The numeral -A is negative ten by ordinary signed-magnitude notation. The bit pattern F6, on the other hand, is decimal 246 when unsigned and −10 when interpreted as an eight-bit two's-complement value.
For an unsigned value u that fits in a w-bit field, its two's-complement interpretation is:
- If
u < 2^(w−1), the signed value isu. - Otherwise, the signed value is
u − 2^w.
The input must satisfy 0 ≤ u < 2^w. For eight-bit F6, the sign threshold is 128, and 246 − 256 gives −10.
Width is part of the interpretation. The sixteen-bit pattern 00F6 represents positive 246 because its sixteen-bit sign bit is zero. The digits F6 alone do not tell you whether the field was intended to be eight bits, sixteen bits, or an unsigned magnitude.
Before choosing a calculator's signed mode, check the field definition. Do not infer signedness merely because the first digit is a letter. Digits 8 and 9 also set the highest bit in a fully occupied hexadecimal position.
Convert Hexadecimal Fractions Using Negative Powers
For hexadecimal fractions, positions to the right of the radix point have weights 16⁻¹, 16⁻², and so on. These equal 1/16, 1/256, and successively smaller fractions.
Consider 3.A4:
3 + (10 ÷ 16) + (4 ÷ 256) = 3 + 0.625 + 0.015625 = 3.640625
The A contributes ten sixteenths, not ten tenths. Treating the written suffix as a decimal fraction would give the wrong result.
A finite base-16 fraction has a terminating decimal expansion, though the output can require several decimal places. Store it with an exact rational or decimal method when an application must preserve every digit; ordinary floating-point calculations can round.
A finite hexadecimal fraction can be expressed with a denominator that is a power of sixteen, and therefore a power of two. Multiplying that denominator by enough factors of five turns it into a power of ten. This is why an exact terminating decimal exists, even when a software library's chosen numeric type does not preserve every required digit.
Integer parsers are not general hexadecimal-fraction converters. Python's int() rejects a radix point, while JavaScript's parseInt() can stop at the point and return only the integer portion. Check the accepted input type before trusting a result for fractional data.
Convert Numeric Strings in Python and JavaScript
Use a number parser with an explicit radix rather than a character-encoding function. Encoding the text characters in 4B9 as bytes is a different task from interpreting that string as a base-16 integer.

Python: Use int() with Base 16
print(int("4B9", 16)) # 1209
print(int("0x4B9", 16)) # 1209
print(int("-A", 16)) # -10
large = int("1000000000000001", 16)
print(large) # 1152921504606846977Python integers support arbitrary precision, subject to available resources. Parsing a long hexadecimal integer does not require routing it through a floating-point value.
Define your input policy separately. A language parser may accept whitespace, signs, or separators that your application's field format does not permit. Successful parsing is not the same as checking that the entire input matches that format.
JavaScript: Use BigInt for Large Integers
For small, validated input, parseInt("4B9", 16) returns 1209. For larger integers, use BigInt to avoid the safe-integer limit of Number:
function unsignedHexToDecimal(input) {
const value = input.trim();
if (!/^(?:0x)?[0-9a-f]+$/i.test(value)) {
throw new Error("Expected an unsigned hexadecimal integer");
}
const digits = value.replace(/^0x/i, "");
return BigInt("0x" + digits).toString(10);
}
console.log(unsignedHexToDecimal("4B9")); // 1209
console.log(unsignedHexToDecimal("0x1000000000000001"));
// 1152921504606846977This function intentionally accepts unsigned whole numbers with an optional 0x prefix. It rejects signs, points, and internal separators.
Number.MAX_SAFE_INTEGER is 2⁵³ − 1, or 9,007,199,254,740,991. Beyond that range, not every integer is exactly representable as a JavaScript Number. Parse the original string directly as BigInt; converting an already rounded Number cannot recover the lost value.
Interpret Byte Sequences Before Combining Them
A hexadecimal numeral and a list of bytes are related but not interchangeable. The numeric string 012C represents decimal 300. The byte sequence 01 2C represents that integer only if the field uses the corresponding big-endian order.
In little-endian order, those same two bytes produce integer 2C01, which is decimal 11,265.
Input Data | Interpretation | Decimal Result |
Numeral | Ordinary unsigned hexadecimal | 300 |
Bytes | Big-endian unsigned field | 300 |
Bytes | Little-endian unsigned field | 11,265 |
Endianness determines byte order within a multibyte field. It does not change each individual digit's numeric value or mean you should reverse every hexadecimal string.
Also check what the field contains. A dump can include text, several numeric fields, padding, or an encoded floating-point value. Converting the entire dump as one integer may produce a mathematically valid result that has no useful meaning for the format.

Validate the Input and the Calculator's Output
When using a hexadecimal-to-decimal converter, select hexadecimal as the input base and decimal as the output base. Then check whether its mode is unsigned, signed with a specified width, or fractional.
Common sources of disagreement include:
Symptom | Likely Check |
| The input may have been treated as decimal |
Output becomes negative | Inspect signed mode and bit width |
Long values lose their last digits | Check integer precision and output formatting |
A value containing a point loses its fraction | Check whether an integer parser was used |
Spaced input changes meaning | Confirm byte order and separator rules |
Input validation should reject unsupported characters rather than silently removing them. For example, parseInt("2CG", 16) returns 44 after stopping at G. A strict validator should reject the incomplete parse when the whole field must be hexadecimal.
Leading zeros do not change an unsigned magnitude, but they can carry required field-width information. Preserve the original input when you are also interpreting a signed or byte-oriented value.
Questions About Hexadecimal Conversion
How do you convert hex to decimal?
Multiply each digit's numeric value by 16 raised to its position, starting with position zero on the right, and add the products. Replace A–F with 10–15 first. For whole-number input, this gives the unsigned magnitude. Signed bit patterns and fractional values require their additional interpretation rules.
What is FF in decimal?
FF equals 255 as an unsigned value: 15 × 16 + 15 = 255. If it represents an eight-bit two's-complement field, the same bits mean −1. Those answers are consistent because the interpretation differs. Specify unsigned or signed mode and the width when the surrounding format uses fixed-size integers.
What does the 0x prefix mean?
The 0x prefix identifies a hexadecimal integer literal in many programming languages and tools. It is not part of the digits being multiplied by powers of sixteen. For example, 0x2C and hexadecimal 2C describe decimal 44. A particular converter must support that prefix; not every input format does.
How do negative hexadecimal numbers become decimal?
A numeral with a leading minus sign uses its negative magnitude. A fixed-width two's-complement pattern must instead be interpreted using the field's sign bit and width. These are different operations. For an eight-bit pattern with the highest bit set, subtract 256 from the unsigned value to obtain its signed value.
Can a hexadecimal number have a fractional part?
Yes. Positions after the radix point use negative powers of sixteen. The first fractional digit has weight 1/16, the next 1/256, and so on. A converter designed only for whole numbers may reject or truncate that input, so select a method that explicitly supports hexadecimal fractions.
How can I convert a very large hexadecimal number exactly?
Use arbitrary-precision integer arithmetic, such as Python's int() or JavaScript's BigInt, starting from the original input string. Avoid a floating-point intermediate. Also confirm that the result is displayed as a complete integer rather than a rounded or scientific-notation summary when copying it into another system.
Is hexadecimal conversion the same as decoding text?
No. Numeric conversion interprets the whole value in a different number base. Text decoding interprets a byte sequence using a character encoding such as ASCII or UTF-8. A string can be valid hexadecimal yet represent binary data that is not readable text. Choose the operation that matches the field's documented meaning.
Check the Meaning Alongside the Arithmetic
Accurate hex to decimal results depend on both place values and input interpretation. Apply powers of sixteen to ordinary numerals, specify width for signed patterns, and establish byte order for binary fields. Verify a sample by reversing the conversion, and use exact integer arithmetic when the value exceeds your calculator's reliable precision.