Shard Tools

Hex to Decimal

Convert a hexadecimal number to decimal in your browser, with full precision for large values.

Maintained by Roshan.

Use Hex to Decimal

Converts hexadecimal number to decimal in this tab, with nothing sent anywhere.

Runs entirely on your deviceThe conversion happens in this browser tab. Nothing you type is uploaded, logged or stored, which is worth knowing for anything you would not paste into a search box.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About Hex to Decimal

Going the other way, from hex to decimal, is what you do when a value written for the machine needs to be understood by a person or fed into arithmetic that thinks in tens. A colour component, a register value, a hash fragment: all are written in hex but often need their plain decimal size. The same precision trap applies as strongly here. A hexadecimal value is frequently large - that is much of why it was written in hex in the first place - and a converter that reads it into an ordinary number loses accuracy past a certain size, turning the last few decimal digits into rounded noise. This tool reads the hex into an arbitrary-precision integer, so even a full 64-bit value converts to its exact decimal equivalent with no digits lost.

Using Hex to Decimal

  1. The hex is read into an arbitrary-precision integer, so there is no size at which the result becomes approximate.
  2. A 0x prefix, spaces and separators are stripped, so a value copied from source code or a debugger works directly.
  3. Each hex digit contributes its value, high digits weighted by powers of sixteen, accumulated exactly.
  4. The output is the plain decimal number, ready for arithmetic or for a person to read.
  5. Case is irrelevant; upper and lower hex digits are treated the same.

Where hex to decimal helps

Understanding a register or colour value

A hex component converts to the decimal number it represents, which is easier to reason about arithmetically.

Reading a large hex identifier

A 64-bit hex value converts to its exact decimal size, with no rounding of the final digits.

Before you use the result

Questions about Hex to Decimal

Will a big hex value stay exact?

Yes. Arbitrary-precision integers are used, so even a 16-digit hex value converts without rounding.

Does it accept a 0x prefix?

Yes. Prefixes, spaces and separators are stripped before conversion.

Is this the same as hex to text?

No. This converts the number's value; hex to text decodes hex bytes into characters.

Does case matter?

No. Upper and lower hex digits are equivalent.

Related tools

Decimal to Hex

Convert a decimal number to hexadecimal in your browser, with full precision for large values.

Binary to Decimal

Convert a binary number to decimal in your browser, with full precision for large values.

Hex to Text

Convert hexadecimal back to text in your browser. Accepts spaced, joined and 0x-prefixed hex.