Hexadecimal to Decimal Converter Formula
Understand the math behind the hexadecimal to decimal converter. Each variable explained with a worked example.
Formulas Used
Decimal Value
decimal_val = h3*4096 + h2*256 + h1*16 + h0Variables
| Variable | Description | Default |
|---|---|---|
h3 | Hex Digit 3 (4096s) | 0 |
h2 | Hex Digit 2 (256s) | 0 |
h1 | Hex Digit 1 (16s) | 15 |
h0 | Hex Digit 0 (1s) | 15 |
How It Works
How to Convert Hexadecimal to Decimal
Method
Hexadecimal (base-16) uses digits 0-9 and letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Enter the numeric value of each hex digit (0-15).
Decimal = d3×4096 + d2×256 + d1×16 + d0×1
For example, hex FF (enter 15, 15): 15×16 + 15×1 = 240 + 15 = 255.
Worked Example
Convert hex 00FF to decimal.
- 010×4096 + 0×256 + 15×16 + 15×1
- 02= 0 + 0 + 240 + 15
- 03= 255
Frequently Asked Questions
What is hexadecimal?
Hexadecimal (base-16) uses 16 symbols: 0-9 and A-F. It is widely used in computing to represent binary data compactly, since each hex digit corresponds to exactly 4 binary bits.
Why is hex used in computing?
Hexadecimal provides a compact way to represent binary. One hex digit equals 4 bits, so a byte (8 bits) is exactly 2 hex digits. This makes it easier to read and write binary values.
What do A-F represent in hex?
A=10, B=11, C=12, D=13, E=14, F=15. Enter these numeric values in the input fields.
Ready to run the numbers?
Open Hexadecimal to Decimal Converter