1. Home
  2. Developer tools
  3. Hex to Decimal

Hex to Decimal

Paste a hex value and read it as a decimal number. The working lists every digit with its power of 16, and the arithmetic is exact, so 64-bit values and longer do not lose digits.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Hex to Decimal

  1. Paste hex numbers, one per line.
  2. Read the decimal value and the place-value working.
  3. Copy it, or check the binary and octal forms of the same number.

Features

  • Digit times power of 16 for every position
  • Exact above 2^53, unlike JavaScript parseInt
  • Accepts 0x and upper or lower case
  • Hex fractions such as A.8 convert to 10.5
  • Converts many values at once
  • Reports the first invalid digit

Supported formats

Input

  • Hex numbers
  • Typed or pasted numbers

You get

  • Decimal
  • Place-value working

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Hex to Decimal is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Numbers are read in the base named by the tool, so a digit outside that base is reported instead of guessed.
  • Values are read as unsigned numbers.

Guide

Hexadecimal to decimal without losing digits

A hexadecimal number is a compact way to write a value, but sooner or later someone asks how big it actually is. Is that file offset a few kilobytes or a few gigabytes? Is the ID in the log the same as the one in the database? Converting to decimal answers those questions, and doing it exactly matters once the numbers get long.

The place-value sum

Hex positions are worth powers of 16: the rightmost is 1, then 16, 256, 4,096, 65,536 and so on. Each digit is multiplied by its position’s worth and the products are added. The digits A to F count as 10 to 15. For 2F the sum is 2 × 16 + 15, which is 47. The working on this page prints each such term, with the letter value in brackets, and finishes with the total.

Why exactness is a feature

Most calculators, spreadsheets and scripting languages hold numbers as 64-bit floating point. They are exact for whole numbers only up to 9,007,199,254,740,992, which is 2 to the power 53. A 64-bit identifier, a hash fragment or a large file offset can be above that limit, and the conversion then silently rounds the last digits. This page keeps the whole value as a big integer, so it is exact whatever the length. The test is easy to repeat: twenty F digits give 1,208,925,819,614,629,174,706,175, which is 2 to the 80th power minus one.

Options

A 0x prefix and mixed-case letters are fine; spaces and underscores are ignored, so you can paste a value grouped the way a debugger prints it. A minus sign is carried over to the answer. “Group digits” inserts separators into the decimal result so a 20-digit number can be read. Paste several values, one per line, and each gets its own result.

Edge cases

Hex has fractions too. A.8 is 10 plus 8/16, so 10.5. The digits after the point use negative powers of 16, and the working shows them as 8 × 16⁻¹ = 0.5. A character outside 0–9 and A–F is reported with its position, which catches a typical copy mistake like the letter O instead of zero. Leading zeros are accepted and have no effect.

The page reads values as unsigned. FF is 255, not −1; for signed interpretations choose a width in the two’s complement calculator.

A worked example

The Sample button loads 1F4A.8. The integer part contributes 1 × 4,096 = 4,096, F (15) × 256 = 3,840, 4 × 16 = 64 and A (10) × 1 = 10, which add up to 8,010. The fraction 8 × 16⁻¹ is 0.5. The total is 8010.5. The panel below shows the same number as 1111101001010.1 in binary and 17512.4 in octal, which you can use to check the figure from another direction.

Limits

This is a number converter. It does not treat the input as a string of bytes, a colour or a hash, and it does not apply endianness; if bytes arrive in network order and you need to flip them first, the endian converter does that. Extremely long inputs work, but their working lists get long, so turn the working off when you only need the result.

Checked against the current version of the Hex to Decimal on .

Frequently asked questions

What is 0xFFFFFFFF in decimal and why is it important?

It is 4,294,967,295, the largest value an unsigned 32-bit integer can hold. Anything above it needs more than 32 bits, which is why counters and sizes sometimes overflow at that point.

Why does my programming language print a different number for a long hex value?

Languages that store numbers as 64-bit floating point, JavaScript among them, keep only about 15 to 17 significant digits. A long hex value is rounded on the way. Use big integers, as this page does, to see every digit.

What is 0xFF in decimal?

255, because F is 15 and 15 × 16 + 15 = 255. It is the largest value a byte can hold.

Why do long hex values come out exactly here?

The conversion uses arbitrary-precision integers. Many tools use floating-point numbers, which can only hold integers exactly up to 9,007,199,254,740,991.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.