What Is Hexadecimal (Hex)? A Simple Explanation
Why computing uses base-16, how hex maps to bytes and colours, and how text becomes hex.
Hexadecimal is base-16
Hexadecimal uses sixteen digits: 0–9 then A–F, where A=10, B=11, up to F=15. It’s a compact way to write binary: because 16 is 2 to the power of 4, exactly four binary bits map to one hex digit, and one byte (8 bits) becomes just two hex digits.
Why programmers use it
Hex is everywhere in computing — memory addresses, byte values, error codes and especially colour codes (like #FF8800 in web design, where pairs of hex digits set red, green and blue). It’s far easier to read and type than long strings of 0s and 1s.
How text becomes hex
Each character has a numeric code point; in UTF-8 that value is written in base-16. The letter “A” (code 65) is 41 in hex, and “a” (97) is 61. A text-to-hex tool encodes each character’s byte value so you can see exactly how text is stored.
FAQ
Why are colour codes in hex?+
A hex colour like #RRGGBB uses two hex digits (one byte, 0–255) each for red, green and blue — a compact, exact way to specify 16 million colours.