Convert Hexadecimal to Decimal

Convert hexadecimal numbers to decimal with clear examples. Learn how hex digits A-F map to values 10-15 and how to calculate the decimal equivalent easily.

Hexadecimal (Base 16)Decimal (Base 10)Conversion

Detailed Explanation

Hexadecimal (base 16) uses digits 0-9 and letters A-F, where A=10, B=11, C=12, D=13, E=14, and F=15. Converting hex to decimal follows the same positional notation principle as binary, but using powers of 16 instead of 2.

Step-by-step example — converting 1A3F to decimal:

  1. Write each digit with its position (right to left): 1(3) A(2) 3(1) F(0)
  2. Replace letters with values: 1(3) 10(2) 3(1) 15(0)
  3. Multiply by powers of 16: 1×16³ + 10×16² + 3×16¹ + 15×16⁰
  4. Calculate: 4096 + 2560 + 48 + 15 = 6719

So 0x1A3F = 6719₁₀.

Why hexadecimal is important:

Hex is widely used in computing because it provides a compact representation of binary data. Each hex digit maps to exactly 4 binary bits, making conversion between hex and binary trivial. A single byte (8 bits) is always exactly 2 hex digits, which is far easier to read than 8 binary digits.

Common hex values you should recognize:

  • 0xFF = 255 — maximum value of a single byte
  • 0x100 = 256 — one more than a byte can hold
  • 0xFFFF = 65535 — maximum 16-bit unsigned value
  • 0x7FFFFFFF = 2147483647 — maximum 32-bit signed integer
  • 0xDEADBEEF = 3735928559 — classic magic number used in debugging

Programming shortcuts:

Most languages accept hex literals directly. In JavaScript, 0x1A3F evaluates to 6719. In Python, int("1A3F", 16) returns the same result. The 0x prefix is a universal convention indicating a hexadecimal number. Understanding hex-to-decimal conversion is essential for reading memory dumps, debugging binary protocols, and working with color codes.

Use Case

When analyzing memory dumps or crash reports, developers convert hex addresses like 0x7FFF5FBFF8A0 to decimal to calculate offsets and understand memory layout.

Try It — Number Base Converter

Open full tool