ToolDash
Hex to Decimal Converter

Hex to Decimal Converter

Type a hexadecimal number and get its decimal value instantly, with the multiplication by powers of 16 written out so you can follow or check it.

  • Free, no sign-up
  • Runs in your browser — nothing is uploaded
  • Instant results, no waiting on a server

Type a hex value (0x prefix optional, any case) to get its decimal value and the digit-by-digit working.

Input base

Try a value in hexadecimal

Hexadecimal → Decimal

—

Binary (base 2)

—

Octal (base 8)

—

Decimal (base 10)

—

Hexadecimal (base 16)

—

How to convert hex to decimal with this tool

  1. 1Type or paste a hex value into the Value field. Hexadecimal is already selected as the input base, a 0x prefix is optional, and upper or lower case both work.
  2. 2Read the decimal result in the highlighted box. It updates on every keystroke.
  3. 3Look under Working to see each digit multiplied by its power of 16 and the place values added up.
  4. 4Copy the decimal with the copy icon. The binary and octal forms of the same number are listed below if you need them.

How to convert hex to decimal by hand

Hexadecimal is base 16. It uses the digits 0 to 9 and then the letters A to F for the values 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Like decimal, it's positional, but each position is worth 16 times the one to its right instead of 10 times. The rightmost digit counts ones, the next counts 16s, then 256s, 4,096s, 65,536s and so on.

To convert hexadecimal to decimal, multiply every digit by 16 raised to its position, counting from 0 on the right, and add the results. Take 0x1F4: 1 x 16^2 + 15 x 16^1 + 4 x 16^0 = 256 + 240 + 4 = 500. Another example is 0xFF, which is 15 x 16 + 15 = 255, the largest value a single byte can hold. Going left to right is often quicker: start at 0, and for each digit multiply the running total by 16 and add the digit. For 1F4 that's 1, then 1 x 16 + 15 = 31, then 31 x 16 + 4 = 500.

Some values are worth recognising. 0x10 is 16, 0x100 is 256, 0xFFFF is 65,535 (the largest 16-bit value), and 0x7FFFFFFF is 2,147,483,647, the maximum of a signed 32-bit integer. CSS colours are three hex bytes: #1E90FF means red 0x1E = 30, green 0x90 = 144 and blue 0xFF = 255.

This tool treats the input as an unsigned whole number. In code, a register or byte value like 0xFFFFFFFF might be meant as a signed two's complement number, in which case it's -1 rather than 4,294,967,295. Big values are a common trap too: JavaScript's parseInt('ffffffffffffffff', 16) returns 18446744073709552000 because doubles can't hold integers above 2^53 exactly. The converter uses BigInt, so it shows the true value, 18,446,744,073,709,551,615.

Where hex values come from

Debuggers and memory dumps

Turn addresses, offsets and register values into decimal to compare them with sizes and indexes.

Error and status codes

Windows HRESULTs, Linux errno values and hardware registers are usually printed in hex.

Colours

Read the red, green and blue channel values out of a #RRGGBB colour code.

Protocols and file formats

Decode lengths, flags and IDs from packet captures, hex editors and binary file headers.

Frequently asked questions

What is 0xFF in decimal?

+

255. F is 15, so 0xFF is 15 x 16 + 15 = 255, the largest value that fits in one byte.

What do the letters A to F mean in hex?

+

They are single digits for the values 10 to 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Case doesn't matter.

How do I convert hex to decimal in code?

+

In JavaScript use parseInt('1f4', 16), or BigInt('0x1f4') for values above 2^53. In Python use int('1f4', 16). In Excel, =HEX2DEC("1F4") works for up to 10 hex digits.

Can it convert negative or signed hex values?

+

It reads hex as an unsigned number. For a signed two's complement value, check the top bit: if it's set at your bit width, subtract 2^bits. For example, 0xFF as a signed 8-bit value is 255 - 256 = -1.

Is there a limit on how long the hex number can be?

+

No practical limit. The conversion uses BigInt, so 64-bit, 128-bit and longer values stay exact. The step-by-step working is shown for up to 32 digits.