Hex To Decimal Converter
Enter the hexadecimal value to convert to decimal or Decimal to Hexadecimal.
Hexadecimal:
Hexadecimal (Base-16) uses digits 0-9 and letters A-F. It is widely used in computing for memory addresses, color codes, and machine instructions.
Decimal:
Decimal (Base-10) is the standard number system used in everyday mathematics and commerce.
How to Convert Hexadecimal to Decimal — Formula:
Decimal = Σ(dᵢ × 16ⁱ) where dᵢ is the value of each hex digit (0-15) and i is its position from right.
Example: Hex 1A3F = (1×16³) + (10×16²) + (3×16¹) + (15×16⁰) = 4096 + 2560 + 48 + 15 = 6719.
Technical Details:
Hex digits: 0-9 = 0-9, A=10, B=11, C=12, D=13, E=14, F=15. One hex digit = 4 bits (nibble). Two hex digits = 1 byte (00-FF = 0-255). Common values: 0xFF = 255, 0x100 = 256, 0xFFFF = 65535.
Hex To Decimal Converter:
Convert hexadecimal numbers to decimal instantly. Each hex digit represents 4 binary bits, making it a compact representation for binary data.
Hexadecimal to Decimal: Positional Notation
Frequently Asked Questions
How do I convert Hexadecimal to Decimal?
Decimal = Σ(dᵢ × 16ⁱ) where dᵢ is the value of each hex digit (0-15) and i is its position from right.
What is the Hexadecimal number system?
Hexadecimal (Base-16) uses digits 0-9 and letters A-F. It is widely used in computing for memory addresses, color codes, and machine instructions.
What is the Decimal number system?
Decimal (Base-10) is the standard number system used in everyday mathematics and commerce.
Where is Hexadecimal to Decimal conversion used?
Hex digits: 0-9 = 0-9, A=10, B=11, C=12, D=13, E=14, F=15. One hex digit = 4 bits (nibble). Two hex digits = 1 byte (00-FF = 0-255). Common values: 0xFF = 255, 0x100 = 256, 0xFFFF = 65535.
Can I convert large hexadecimal numbers?
Yes. This converter handles numbers of any practical size. For very large numbers, the conversion is performed using arbitrary-precision arithmetic to ensure accuracy.
How to Convert Hexadecimal to Decimal (Base-16 to Base-10)
Converting hex to decimal is needed when interpreting memory addresses, reading debugger output, or converting CSS hex colors to RGB values. Each hex digit position represents a power of 16, so multiply each digit by its positional value and sum.
- Assign each hex digit a position value: rightmost = 16⁰, next = 16¹, etc.
- Convert any letters to their numeric values: A=10, B=11, C=12, D=13, E=14, F=15.
- Multiply each digit by its positional power of 16.
- Sum all the products.
- Example: 0xFF → F×16¹ + F×16⁰ = 15×16 + 15×1 = 240 + 15 = 255.
Hex to Decimal: Essential Values
Key hex values that every developer should recognize in decimal:
| Input | Output |
|---|---|
| 0x10 | 16 |
| 0x20 | 32 |
| 0x41 | 65 |
| 0x64 | 100 |
| 0x7F | 127 |
| 0xFF | 255 |
| 0x400 | 1,024 |
| 0xFFFF | 65,535 |
Solved Examples: Hex to Decimal
Question 1: Convert the CSS color channel #B7 to a decimal RGB value.
Solution:
B = 11, 7 = 7
Decimal = 11×16 + 7×1
= 176 + 7 = 183
Answer: 0xB7 = 183 — this green or blue channel at 183/255 ≈ 72% intensity.
Question 2: A debugger shows a function at address 0x1A4F. What is the decimal address?
Solution:
1×16³ + A×16² + 4×16¹ + F×16⁰
= 1×4096 + 10×256 + 4×16 + 15×1
= 4096 + 2560 + 64 + 15 = 6,735
Answer: 0x1A4F = 6,735₁₀ — this is offset 6,735 bytes from the base address.
Question 3: A file size is reported as 0x100000 bytes. Convert to decimal.
Solution:
1×16⁵ + 0×16⁴ + 0×16³ + 0×16² + 0×16¹ + 0×16⁰
= 1×1,048,576
= 1,048,576
Answer: 0x100000 = 1,048,576 bytes = 1 MiB (mebibyte) — exactly 2²⁰ bytes.
Practice: Hex to Decimal
Try solving these on your own to test your understanding:
- Convert 0x2A to decimal. (Answer: 42)
- Convert 0xF0 to decimal. (Answer: 240)
- Convert 0x1FF to decimal. (Answer: 511)
- Convert 0xCAFE to decimal. (Answer: 51966)
- Convert 0x3E8 to decimal. (Answer: 1000)
Debugging with Hex: Reading Crash Dumps
When a program crashes, the error report shows addresses in hex: "Segfault at 0x00000000" (null pointer dereference) or "Access violation at 0xDEADBEEF" (use-after-free with debug sentinel). Converting these to decimal helps calculate offsets: if the base address is 0x08048000 (134,512,640) and the crash is at 0x0804812C (134,513,964), the offset is 0x12C = 300 bytes from the start — pointing you to the exact instruction in the code.
ASCII Table: The Hex-Decimal Connection
The ASCII table maps characters to numbers: A=0x41(65), Z=0x5A(90), a=0x61(97), z=0x7A(122), 0=0x30(48), 9=0x39(57). In hex, the pattern is clearer: uppercase starts at 0x40, lowercase at 0x60, digits at 0x30. To convert uppercase to lowercase: add 0x20 (32 in decimal). These hex-decimal relationships explain why string functions work the way they do in low-level languages.
Key Takeaways
- Multiply each hex digit by its power of 16, then sum.
- For single bytes: high digit × 16 + low digit = decimal value.
- Key values: 0xFF=255, 0x100=256, 0x400=1024, 0xFFFF=65535.
- Memory addresses and file sizes in hex reveal alignment that decimal hides.
- ASCII in hex shows systematic patterns (add 0x20 for lowercase conversion).