Encoding desk

Hex to Decimal

Convert a signed hexadecimal integer to decimal with exact arbitrary-size arithmetic.

Hex to Decimal: Translate a hexadecimal integer into its base-10 magnitude. Hex to Decimal accepts digits 0–9 and letters A–F in either case, with an optional sign. It is useful for numeric constants from documentation, provided you first identify whether the source describes a numeral, a byte sequence or a packed decimal field. Runs 100% locally in your browser with zero server file uploads.

Runs
In your browser
Cost
Free · no sign-up
Availability
Ready to use
Hex → Decimal / local workbenchLocal processing

Runs entirely in your browser

256 character input · 1,024 character output

Result

Ready

Conversions run locally. Numeric values are integers, signs are normalized, and prefixes such as 0b or 0o are intentionally not accepted.

Hex place values and calculation

Let d_i be the numeric value of a hex digit at position i from the right: A=10, B=11, C=12, D=13, E=14 and F=15. Magnitude N = sum of d_i × 16^i. Enter 2AF: 2×256 + 10×16 + 15×1 = 512 + 160 + 15 = 687, so the result is 687. That sum is not BCD: a packed 8421 BCD field stores decimal digits separately and cannot use A–F as ordinary decimal digits. The HEX to RGB tool separates colour channels when that is your source.

Byte order and large identifiers

Little-endian storage places the least significant byte first; big-endian places the most significant first, as described in Cornell’s byte reference (https://www.cs.cornell.edu/courses/cs3110/2020sp/manual-4.8/libref/Bytes.html). The converter does not swap them.

It accepts 256 input characters and permits 1,024 output characters, using exact integers instead of floating-point numbers. No field-width overflow is tested. Preserve long identifiers as strings when exporting: JavaScript Number loses guaranteed integer precision beyond 2^53 − 1 (https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number.max_safe_integer), even though this decimal result remains exact.

How to use it

  1. Enter the value in the format shown below.
  2. Run the conversion and check the result against your source convention.
  3. Copy or download the output in the form required by your destination.

Privacy & limitations

Conversion runs in your browser. Your values and results are not uploaded.

Related tools

Frequently asked questions

Why are 0x, spaces and a CSS hash rejected?

This field expects only the integer digits plus an optional leading sign. Strip 0x or # before entry, and do not include byte separators. For a colour, converting each two-digit channel separately gives channel values; converting all six digits yields one combined integer.

Will the converter recognise little-endian bytes?

No. Hex digits are interpreted in their written positional order. Bytes 34 12 from a little-endian 16-bit field describe the numeral 1234, which is decimal 4660. Concatenating them as 3412 instead yields 13330. Reorder complete byte pairs using the source format, not individual digits.

Is a high-bit hex value a signed negative number?

A leading minus sign is required for a negative conversion. FF therefore gives 255. If the source says signed eight-bit two’s complement, subtract 2^8 from that unsigned result to obtain −1. Without a specified width, the sign cannot be inferred from F or any other digit.

Free tool · runs in your browser · no account required