Binary (Base-2)
Computers use binary because transistors are either "on" (1) or "off" (0).
- Decimal 1 = Binary 0001
- Decimal 5 = Binary 0101
- Decimal 10 = Binary 1010
Hexadecimal (Base-16)
Binary is hard for humans to read. Hexadecimal is a "shorthand" that uses 0-9 and A-F.
- A = 10
- F = 15
- Hex #FF = Decimal 255 (The max value of a byte)
Why Hex for Colors?
Web colors are usually hex codes (like #FF5733). This is because each pair of characters represents the intensity of Red, Green, and Blue (RGB) in a single byte.
Key Takeaways
- Binary is the fundamental computer language
- Hex is a human-readable way to see binary
- Each hex digit represents 4 bits (a "nibble")