Online Hex to Decimal Converter

A value copied from code may be in hexadecimal when you need its decimal value. The online HEX to Decimal converter changes a base-16 integer into a base-10 number.

This article shows how to convert a value by hand and use the online converter, including which inputs it accepts.

TL;DR

Enter a hexadecimal integer in the converter and select Convert to Decimal to get its base-10 value. For example, 1A3 converts to 419 because 1 × 16² + 10 × 16¹ + 3 × 16⁰ equals 419.

  • Use digits 0–9 and letters A–F only.
  • An optional 0x prefix and leading or trailing spaces are accepted.
  • Values above 9007199254740991 may not convert exactly in JavaScript Number arithmetic.

What is hexadecimal and decimal?

Hexadecimal is base 16, while decimal is base 10. Hex uses digits 0–9 and A–F, where A means ten and F means fifteen. In hex, 10 equals decimal 16.

Decimal 419 consists of four hundreds, one ten, and nine units.

SystemBaseDigitsExample
Binary20–11010₂ = 10
Decimal100–910₁₀ = 10
Hexadecimal160–9, A–FA₁₆ = 10

A single hexadecimal digit maps to four binary bits, called a nibble. A pair forms a byte, spanning 00 through FF or 0 through 255. This relationship lets you read a byte without converting each bit separately.

How to convert a hexadecimal value by hand

Multiply each digit’s value by its place value, then add the contributions. In 1A3, the rightmost digit is in the 1s place, A is in the 16s place, and 1 is in the 256s place.

Step 1: Map each digit to its value

Map each letter to the value shown, then use that number in the multiplication.

Hex digitDecimal value
A10
B11
C12
D13
E14
F15

Step 2: Assign place values from right to left

Starting at the right, assign 1, 16, 256, and higher place values in sequence. A zero digit still occupies its column so later digits stay aligned. For a long value, find the leftmost place by counting its digits.

Step 3: Multiply and add

For 1A3, the place-value table gives 256 + 160 + 3, which totals 419. This confirms 1A3₁₆ = 419₁₀ without relying on a converter.

For 7DE, calculate 7 × 256 + 13 × 16 + 14 to get 2014. The leading digit has two digits to its right.

A five-digit value extends the sequence to 16⁴ for its leftmost digit.

The table separates each digit’s value from its positional weight. A misplaced weight stands out during a check.

Hex digitValuePositionContribution
1116²256
A1016¹160
3316⁰3
Total419

FF equals (15 × 16) + 15, which is 255. The repeated F has a different positional weight in each column.

How to use the online HEX to decimal converter

Use the field for one uninterrupted hex integer at a time. Clear both fields before a second conversion.

Step 1: Enter the hexadecimal integer

The field accepts uppercase or lowercase digits and trims whitespace at either end. For example, spaces around 1A3 are removed before conversion. Check the remaining characters if conversion reports an error.

In many programming languages, 0x marks a hexadecimal numeral. This tool removes one leading prefix before checking the remaining characters.

Step 2: Convert the value

Select Convert to Decimal to show the result. Check FF by calculating 15 × 16 + 15, which gives 255. Review the input if your result differs.

Step 3: Copy or clear the result

Copy the displayed decimal value into the application that needs it. Select Clear All to empty both fields before another conversion. This reset lets you start with a clean input and output.

Keep the original hex string with the result in code or data records so you can trace the conversion later.

The page uses JavaScript’s parseInt with radix 16, which tells the parser to interpret A–F as hexadecimal digits. Retain the input alongside the output for a traceable record.

Input rules and conversion limits

The input examples below show which variations this page accepts, including prefixed and padded values.

InputExpected behaviorWhat to do
lowercase 1a3Accepted as 419Case does not change digit values.
prefixed value 0x1A3Accepted as 419The tool strips the prefix.
value with outer spacesAccepted as 419Only surrounding whitespace is trimmed.
value with internal spaceRejectedRemove the separator only if it is not meaningful.
color token #FFFFFFRejectedRemove # before entering a color value.
invalid digit 1G3RejectedCheck the source for the unexpected character.
empty inputRejectedEnter at least one digit.

Without validation, parseInt can stop at an invalid character and return the valid prefix. This behavior can hide a typo. For rejected text, the output field identifies the allowed hexadecimal characters.

A leading minus sign, underscore, comma, or internal line break fails validation. Check the source format before removing separators.

The table shows common input outcomes. Before removing a visible character, check whether it belongs to an address, color token, or signed representation.

Leading zeros do not change the numeric result, though 00FF and FF preserve different written widths. A fixed-width field may require exactly four digits, so keep the original text.

A byte is commonly written with two hex digits, so 0A and A have the same value but different formatting. This converter returns a number without padding.

A CSS color token such as #FFFFFF has a leading hash and three two-digit color channels. Remove the hash and enter the six digits as one integer to get 16777215. Each pair is 255, so the RGB value is (255, 255, 255).

Hexadecimal fractions use place values after the radix point, such as 16⁻¹. Use a fraction-capable calculator for values with a point.

For example, 0.8₁₆ equals 8 × 16⁻¹, or 0.5 in decimal.

The first fractional place is one-sixteenth and the next is one-two-hundred-fifty-sixth.

JavaScript Number is exact through 9007199254740991. Larger values can round. JavaScript BigInt keeps a 0x-prefixed integer exact when passed directly from its string.

FF equals 255 as an unsigned byte and -1 in eight-bit two’s-complement (255 − 256). The converter returns 255, so check the source width and signed convention.

For a signed field, check its bit width and encoding because leading bits affect the sign.

This page converts a typed value. Use a hex viewer to inspect bytes in a file or decode them as text.

Zero converts to zero, but an empty field has no digit to parse. Colons in a byte address mark separate groups. Preserve those boundaries when reading an address.

Binary groups 0010 and 1111 map to 2 and F, making 00101111 equal to hex 2F or decimal 47. This cross-check works for one byte.

For multi-byte values, the sequence 01 02 changes meaning with byte order. The first byte may have the highest or lowest place value, so check the format before converting.

To reverse 419, divide by 16 and record remainders 3, 10, and 1. Read them upward and map 10 to A for 1A3. Each remainder becomes one hex digit.

Conclusion

For a nonnegative integer, use the converter and interpret its result according to the source format. CodeForGeek’s HEX to RGB converter handles color notation. Use the RGB to HEX converter when starting with channel values.

FAQ

These answers cover the input and output details that commonly cause a conversion mismatch.

What is 1A3 in decimal?

1A3 in hexadecimal is 419 in decimal: 1 × 16² + 10 × 16 + 3 = 419.

Does the converter accept a 0x prefix?

Yes. It removes a leading 0x prefix after trimming surrounding whitespace.

Can I enter spaces or a hash sign?

Whitespace at the beginning or end is trimmed, but spaces inside the digits and a leading # are rejected.

Why can a very large result be inaccurate?

The converter uses JavaScript Number parsing, which cannot represent every integer exactly above 9007199254740991. Use a BigInt-based converter for exact large integers.

Aditya Gupta
Aditya Gupta

Aditya Gupta is a founding member and editor at CodeForGeek. He first found his way into tech by reading articles, and now writes approachable guides to Node.js security, authentication, AI tools, coding agents, and web scraping.

Articles: 529