Skip to main content
Data / Number / Computer Science Tools

Hex to Decimal Converter

Convert a hexadecimal number to its exact decimal value, handling arbitrarily large hex numbers correctly.

Enter a hexadecimal number below (with or without a 0x prefix) - this tool converts it to decimal exactly.

For the reverse direction, see the Decimal to Hex Converter.

How Hex-to-Decimal Conversion Works

Each hex digit (0-9, A-F) represents a power of 16 based on its position - the decimal value is the sum of each digit's value multiplied by 16 raised to its position.

How to Use It

  1. Enter a hex number, with or without a leading 0x.
  2. The decimal equivalent appears instantly.

Limitations

This handles arbitrarily large hex integers accurately using BigInt, avoiding the precision loss that plain JavaScript number parsing would introduce for very long hex strings.

Worked Example

Convert 0x1F4 to decimal. Each position is a power of 16:

  • 1 × 162 = 1 × 256 = 256
  • F (15) × 161 = 240
  • 4 × 160 = 4

256 + 240 + 4 = 500.

Common Conversions

HexDecimalWhere you see it
FF255Maximum of one byte, one colour channel
100256Number of values in a byte
7FFFFFFF2,147,483,647Largest signed 32-bit integer
FFFF65,535Largest 16-bit value, highest port number

Tips

  • Letters can be upper or lower case - ff and FF are the same.
  • Prefixes vary by context: 0x in code, # for colours, U+ for Unicode, h suffix in some assembly languages.
  • To read a colour like #1E56E3, convert each pair separately: 1E = 30, 56 = 86, E3 = 227.

Convert back with Decimal to Hex. For binary, use Number Base Converter.

Frequently Asked Questions

They represent the values 10 to 15, so one hex digit covers 0-15. FF = 15 x 16 + 15 = 255.

The 0x prefix only marks a number as hexadecimal in code. Enter the hex digits themselves; the case of A-F does not matter.

In colour codes (#FF5733), memory addresses, byte values, hashes and MAC addresses, because each hex digit maps to exactly 4 bits.
Share this tool: