Skip to content
ZeroServer.tools

Hex to Decimal Converter

Convert hexadecimal (base 16) numbers to decimal (base 10).

Decimal

Hexadecimal to decimal, explained

Each hex digit is a power of 16, and letters A–F stand for 10–15. To convert, multiply each digit by its place value and add them up — so ff = 15×16 + 15 = 255. A leading 0x prefix is accepted and ignored. Everything is computed locally.

Built and maintained by Meet Shah · Last updated

What this tool is used for

  • Reading a byte offset or a memory address from a debugger as an ordinary number.
  • Turning a hex error or status code from a log into a value you can look up in a table.
  • Converting a colour channel from a hex triplet into the 0-255 value a design tool wants.
  • Checking the size of a hex-quoted length field against what you expected in bytes.
  • Reading a hex-encoded identifier as a number to compare it against a decimal one.

Frequently Asked Questions

What do the letters mean?
A through F are the digits for values 10 to 15, since base 16 needs sixteen symbols. Case is irrelevant to the value — 0xFF and 0xff are both 255 — though conventions differ, with hashes usually lowercase and colours often uppercase.
Why is hex used for colours and memory?
Each hex digit is exactly 4 bits, so two digits are precisely one byte. #RRGGBB is three bytes, and a memory address in hex maps directly onto its binary pattern — something decimal cannot do without arithmetic.
How do I recognise a hex value in code?
By its prefix: 0x in C, Java, JavaScript and Python; # for CSS colours; \x in string escapes; and $ or &H in older assemblers and BASIC. A bare string of digits and letters is ambiguous without one.
What are the common byte boundaries?
0xFF is 255 (one byte), 0xFFFF is 65535 (two), 0xFFFFFFFF is 4294967295 (four). Recognising these on sight makes overflow and off-by-one bugs obvious — 4294967296 appearing in a log is a 32-bit wrap.
Is there a shortcut to convert by hand?
Go via binary: each hex digit expands to four bits independently, with no carrying between digits. That is far less error-prone than repeated division by 16, and it is why hex and binary are considered interchangeable in practice.
How do I convert a two-digit hex byte in my head?
Multiply the first digit by 16 and add the second — `3F` is 48 plus 15, so 63. Memorising the letter values (A=10 through F=15) is the only part that needs learning.
Why do hex values in documentation carry different prefixes?
Because the convention is language-specific: `0x` in C-family languages, `#` for colours, `$` in older assemblers, and a trailing `h` in Intel syntax. They all mean the same base.

Common errors and gotchas

  • Overlooking a `0x` prefix or a trailing `h`, which some tools include and others reject as part of the digits.
  • Treating the value as signed. A hex string carries no sign, so `FFFFFFFF` is either -1 or 4294967295 depending on width.
  • Mixing case and assuming it matters. Hex digits are case-insensitive, unlike the surrounding identifiers.
  • Dropping a leading zero, which changes the byte count even when it does not change the value.
  • Reading a hex float bit pattern as an integer, which gives a huge number rather than the intended value.

Related Converters tools

Private & free — this tool runs entirely in your browser.

IndieKitShip your Next.js startup in days.affiliate