All Tools

Hex to Decimal Converter: Exact, Any Length

Convert hexadecimal to decimal exactly, with or without a 0x prefix, for values of any size such as 64-bit and 128-bit numbers. Runs in your browser. Nothing is uploaded.

Binary digits
Two's complement width

About the Hex to Decimal Converter

This page opens the Number Base Converter with hexadecimal as the input and decimal highlighted at the top of the results. Paste a hex value, with or without the 0x prefix, and you get its exact decimal value along with binary, octal, BCD, Gray code and two's complement. Each result has a Copy button. It works for values of any size, from a single byte to 128-bit hashes and beyond. Everything runs in your browser, and nothing is uploaded.

How to use it

Steps

  1. Type or paste the hexadecimal number. Upper and lower case digits both work, a 0x prefix is accepted, and spaces or underscores between digits are ignored, so 0xFF_FF, ff ff and FFFF are the same value.
  2. Read the decimal value at the top.
  3. If the hex is a signed integer, such as FFFFFFFF read from a 32-bit register, look at the Two's complement row, or switch From to two's complement and paste the bits, to see the signed value.

How hex becomes decimal

Place values

Each hex digit is worth sixteen times the digit to its right. The digits a to f stand for 10 to 15. Reading from the right, the places are worth 1, 16, 256, 4,096, 65,536 and so on. For 2F3: 2 × 256 + 15 × 16 + 3 = 512 + 240 + 3 = 755.

Why programmers use hex

One hex digit is exactly four bits, so a byte is always two hex digits and a 32-bit word is eight. That makes hex a compact way to write memory addresses, colour values such as #FF8800, Unicode code points and hash digests. Converting to decimal is useful when a value has to be compared with a size, a count or a limit written in ordinary numbers.

Large values stay exact

Calculators and spreadsheets store numbers as 64-bit floating point, which only holds 15 to 17 significant decimal digits. A 64-bit hex value such as FFFFFFFFFFFFFFFF is 18,446,744,073,709,551,615, and a spreadsheet would round it. This page uses arbitrary-precision integers, so every digit is exact, for inputs of up to 10,000 hex digits.

Common values

  • FF is 255, 100 is 256 and FFFF is 65,535.
  • 7FFFFFFF is 2,147,483,647, the largest signed 32-bit integer.
  • FFFFFFFF is 4,294,967,295 unsigned, or −1 as a 32-bit two's complement value.

Privacy

The conversion is done by code on this page, in your browser. Your values never leave your device, and nothing is kept once you close the tab.

Related tools

For the reverse, use Decimal to Hex. For binary, see Binary to Decimal. To add, XOR or shift hex numbers, use the Binary Calculator. If the hex is a run of byte codes for text, such as 48 65 6c 6c 6f, use Text to Hex to decode it.

Open-source credits

  • The converter is written for this site and uses no third-party library. Arithmetic uses the browser's built-in BigInt, specified in ECMA-262, the ECMAScript language specification.
  • Two's complement follows the signed integer representation required by ISO/IEC 9899:2024 (C23).

Other related tools