What is hexadecimal?
Hexadecimal is a number system with sixteen digits: 0 – 9, then A (10), B (11), C (12), D (13), E (14) and F (15). Each place is worth 16 times the place to its right, the way each place in an everyday number is worth 10 times. It is also a short way to write binary: one hex digit stands for exactly four binary digits, as shown below.
Source OpenStax Contemporary Mathematics · 4.3 Converting with Base Systems ↗
How to convert hexadecimal to decimal
Here it is with your numbers:
- Place values from the right: 1, 16, 256.
- Multiply: 4 × 256 + 0 × 16 + 0 × 1
- 1,024 + 0 + 0 = 1,024
It means 400 in hex and 1,024 in decimal are the same number.
How to convert decimal to hexadecimal
Here it is with your numbers:
- 1,024 ÷ 16 = 64, remainder 0
- 64 ÷ 16 = 4, remainder 0
- 4 ÷ 16 = 0, remainder 4
- Read the remainders from the bottom up: 400.
It means 1,024 in decimal and 400 in hex are the same number.
How to convert binary to hexadecimal
Here it is with your numbers:
- Groups of four from the right, with zeros added at the front to fill the first group: 0100 0000 0000
- Each group is one hex digit: 0100 is 4, 0000 is 0, 0000 is 0.
- Put them together: 400.
It means 10000000000 in binary and 400 in hex are the same number.
This works because 16 is 2 × 2 × 2 × 2: four binary places count up to 15, exactly one hex digit, so each hex place lines up with four binary places. Going from hex to binary is the same in reverse: write each hex digit as four binary digits.
Hex to decimal chart
Tap a number to convert it.
| Decimal | Hex | Binary |
|---|---|---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 2 | 10 |
| 3 | 3 | 11 |
| 4 | 4 | 100 |
| 5 | 5 | 101 |
| 6 | 6 | 110 |
| 7 | 7 | 111 |
| 8 | 8 | 1000 |
| 9 | 9 | 1001 |
| 10 | A | 1010 |
| 11 | B | 1011 |
| 12 | C | 1100 |
| 13 | D | 1101 |
| 14 | E | 1110 |
| 15 | F | 1111 |
| 16 | 10 | 10000 |
| 32 | 20 | 100000 |
| 100 | 64 | 1100100 |
| 255 | FF | 11111111 |
| 256 | 100 | 100000000 |
| 1,000 | 3E8 | 1111101000 |
| 4,096 | 1000 | 1000000000000 |
FAQs
What is hexadecimal?
Hexadecimal is base 16: it counts with sixteen digits, 0 – 9 and then A, B, C, D, E and F, and each place is worth 16 times the place to its right (1, 16, 256, 4,096 …). So 10 in hex is sixteen, and FF is 255.
Source OpenStax Contemporary Mathematics · 4.3 Converting with Base Systems ↗
What is A in hexadecimal?
A is 10. Hex needs single digits for ten to fifteen, so it uses letters: A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
How to convert hexadecimal to decimal?
Multiply each digit by its place value and add. The place values from the right are 1, 16, 256, 4,096 … For 7EA: 7 × 256 + 14 × 16 + 10 × 1 is 1,792 + 224 + 10, which is 2,026.
How do I convert decimal to hexadecimal?
Divide by 16 again and again, writing down each remainder, until you reach 0. Write remainders of 10 to 15 as A to F, then read them from the last one to the first. 2,026 ÷ 16 is 126 remainder 10 (A), 126 ÷ 16 is 7 remainder 14 (E), and 7 ÷ 16 is 0 remainder 7, so 2,026 is 7EA.