Understanding Base-16 (Hexadecimal)
The Hexadecimal system is a Base-16 numbering system. While humans count in Base-10 (0-9) and computers process in Base-2 (0-1), Hexadecimal bridges the gap. It uses sixteen distinct symbols: the numbers 0 through 9, followed by the letters A through F (representing values 10 through 15).
Why Do Developers Use Hex?
Binary strings are extremely long and difficult for humans to read. Because 16 is a power of 2 ($2^4 = 16$), exactly four binary digits (bits) can be perfectly compressed into a single hexadecimal digit. This makes memory addresses and data packets much easier to read and debug.
Web Colors (RGB)
Web developers use Hex codes (like #FF5733) to define colors. The string is actually three distinct hexadecimal numbers representing Red, Green, and Blue values ranging from 00 (0) to FF (255).
Memory Addresses
If your computer crashes, you might see an error like "Fault at 0x804F2A". The 0x prefix simply tells the system that the following numbers are written in hexadecimal format.
How Hex Addition Works
Adding in hex works exactly like standard math, but you carry over at 16 instead of 10.
9 + 3 in Hex?In normal math, 9 + 3 = 12.
In Hexadecimal, the value of 12 is represented by the letter C.
Therefore,
9 + 3 = C.