Hex to Decimal

Convert hexadecimal numbers to decimal and back.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

Hex to Decimal Converter

Find out what a hexadecimal value means in ordinary decimal numbers. Paste one hex value per line – FF, 0x1F4, #D10505, or 7FFFFFFFh – and get the decimal result immediately: 255, 500, 13698309, and 2147483647. Switch direction to convert decimal numbers to hex.

How to convert hex to decimal

Every hex digit is multiplied by a power of 16 depending on its position, counting from 0 on the right. Letters stand for the values 10–15 (A = 10 … F = 15). For 2AF:

2 × 16² + 10 × 16¹ + 15 × 16⁰ = 512 + 160 + 15 = 687

The converter does the same with exact big integers, so 16-digit hex values (64-bit) and longer hashes come out correct to the last digit – something ordinary calculators often get wrong past 2^53.

Common hex values

  • 0x10 = 16, 0x64 = 100, 0xFF = 255
  • 0x100 = 256, 0x400 = 1024, 0xFFFF = 65,535
  • 0x7FFFFFFF = 2,147,483,647 (largest signed 32-bit integer)
  • 0xFFFFFFFF = 4,294,967,295 (largest unsigned 32-bit integer)

Where hex values come from

You meet hexadecimal in error codes (0x80004005), memory addresses in stack traces, Unicode code points (U+1F600), color codes (#FF8800 → R 255, G 136, B 0), MAC addresses, and hash outputs. Converting them to decimal is often needed to look up a value in documentation, compare it with a limit, or store it in a numeric database column.

Options

Group digits formats large decimal results with thousands separators (4,294,967,295). In the decimal-to-hex direction you can choose uppercase output, a 0x prefix, and byte padding. Hex fractions such as A.8 (10.5) are supported. To decode hex bytes into text instead, use String to Hex.

Frequently Asked Questions

Multiply each hex digit by 16 raised to its position (starting at 0 on the right) and add the results. A–F count as 10–15. 1A = 1 × 16 + 10 = 26.

Yes. The 0x prefix, a leading # (as in color codes), and a trailing h (assembly notation, e.g. 1Fh) are all accepted and ignored.

4,294,967,295 – the largest unsigned 32-bit integer. As a signed 32-bit integer the same bits mean -1.

Most calculators use floating-point numbers that are exact only up to 2^53. This converter uses BigInt, so every digit of a 64-bit or longer value is exact.