If you've ever looked at a color code like #FF5733 or seen a memory address like 0x7FFF5FBFFD74, you've encountered hexadecimal numbers. While it might seem complex, "hex" is a powerful system that makes it much easier for programmers to work with binary data.
What is Hexadecimal?
The hexadecimal system is a base-16 number system. This means it uses sixteen distinct symbols. It uses the familiar digits 0-9 and then uses the letters A, B, C, D, E, and F to represent the values 10 through 15.
- A = 10
- B = 11
- C = 12
- D = 13
- E = 14
- F = 15
The main reason hexadecimal is so useful in computing is its direct relationship with binary. One hexadecimal digit can represent exactly four binary digits (a nibble).
Example: Hex to Binary
The hex digit F is 15 in decimal, which is 1111 in binary.
The hex digit A is 10 in decimal, which is 1010 in binary.
So the hex number A5 is 10100101 in binary. Much shorter and easier to read!
How to Convert Hexadecimal to Decimal
Converting from hex to decimal works just like converting from binary, but using powers of 16 instead of powers of 2.
Example: Convert 2B516 to Decimal
Remember: B = 11.
(2 × 162) + (11 × 161) + (5 × 160)
= (2 × 256) + (11 × 16) + (5 × 1)
= 512 + 176 + 5
= 693
So, the hexadecimal number 2B516 is equal to 69310 in decimal.
Want to convert hex codes quickly? Try our Hexadecimal to Decimal converter.
