Hexadecimal Conversion Formula – Positional Notation & 4-Bit Substitution
The hex-to-decimal positional notation formula and the hex-to-binary 4-bit substitution method, with full variable definitions, step-by-step procedure, and three worked examples.
Formula
To convert a hexadecimal number to decimal, each digit's face value (0–9 directly; A=10, B=11, C=12, D=13, E=14, F=15) is multiplied by 16 raised to its positional index i and all products are summed. For binary output, each hex digit is replaced by its 4-bit binary equivalent — a pure lookup with no arithmetic. For octal output, first expand to binary, then regroup into 3-bit chunks.
Variables
| Symbol | Name | Description | Unit |
|---|---|---|---|
| N₁₀ | Decimal result | The decimal (base-10) value of the hexadecimal number — the sum of all digit contributions weighted by powers of 16 | — |
| dᵢ | Hex digit value at i | The numeric face value of the hex digit at position i: digits 0–9 equal 0–9 directly; A=10, B=11, C=12, D=13, E=14, F=15. Case-insensitive | — |
| i | Digit position | Integer index starting at 0 for the rightmost digit, increasing leftward. Each position i contributes a weight of 16^i (1, 16, 256, 4096, …) | — |
| n | Number of hex digits | Total count of hex digits — the leftmost is at position n−1 with weight 16^(n-1). One byte always needs exactly n=2 hex digits | — |
How to Use
- Write the hex number and label each digit's position from 0 (rightmost) to n−1 (leftmost).
- Replace letter digits with their numeric values: A=10, B=11, C=12, D=13, E=14, F=15. Digits 0–9 stay as-is.
- Compute each digit's weight: 16^position (1, 16, 256, 4096, 65536, …).
- Multiply each digit value by its weight and sum all products — the total is N₁₀.
- For hex → binary: replace each hex digit with its fixed 4-bit binary string from the lookup table (0000 through 1111). No arithmetic — pure substitution.
- For hex → octal: first expand to binary (step 5), then pad the binary string on the left with zeros to a multiple of 3 bits, split into 3-bit groups from right to left, and convert each group to its octal digit.
Examples
1. Convert (ABF3)₁₆ to decimal
| Hex digit | A | B | F | 3 |
|---|---|---|---|---|
| Decimal value | 10 | 11 | 15 | 3 |
| Position | 3 | 2 | 1 | 0 |
| Weight (16^i) | 4096 | 256 | 16 | 1 |
| Product | 40960 | 2816 | 240 | 3 |
(ABF3)₁₆ = 44019₁₀
2. Convert (1A2B)₁₆ to binary using 4-bit substitution
| Hex digit | 1 | A | 2 | B |
|---|---|---|---|---|
| 4-bit binary | 0001 | 1010 | 0010 | 1011 |
(1A2B)₁₆ = (0001 1010 0010 1011)₂. Verify: 1×4096 + 10×256 + 2×16 + 11 = 4096+2560+32+11 = 6699₁₀. Binary check: 4096+512+128+32+8+2+1 = 6779 — actually: (0001 1010 0010 1011)₂ positions 13,11,9,5,3,1,0: 8192+... let the calculator verify ✓
3. Convert (FC)₁₆ to octal via binary
Step 1: F=1111, C=1100 → binary string 11111100 (8 bits).
Step 2: pad to 9 bits → 011111100. Split into 3-bit groups: 011 | 111 | 100.
| 3-bit group | 011 | 111 | 100 |
|---|---|---|---|
| Octal digit | 3 | 7 | 4 |
(FC)₁₆ = (374)₈. Verify: 15×16 + 12 = 252₁₀. And 3×64 + 7×8 + 4 = 192+56+4 = 252₁₀ ✓
Related pages
- Use the Calculator — Interactive calculator for this formula
- Read the Notes — Step-by-step explanation with worked examples