Most people count in base 10 — decimal. But computers think in base 2, programmers often write in base 16, and Unix file permissions use base 8. Understanding these number systems makes you a better developer.
The Four Number Systems
Decimal (Base 10) — digits 0 to 9, the system everyone uses daily. Example: 255
Binary (Base 2) — digits 0 and 1, the native language of computers. Every piece of data is ultimately binary. Example: 11111111 which equals 255
Hexadecimal (Base 16) — uses 0 to 9 and A to F. Each hex digit represents 4 binary bits, making it compact for memory addresses, color codes, and hashes. Example: FF which equals 255
Octal (Base 8) — uses 0 to 7, still used in Unix file permissions. Example: 377 which equals 255
Why Hexadecimal?
Hex is a compact representation of binary. One byte fits exactly in two hex digits, making hex essential for memory addresses like 0x7ffee4b2, color codes like #FF5733, SHA256 hashes, and MAC addresses.
Why Computers Actually Use Binary
Binary isn't an arbitrary design choice — it maps directly onto the physical reality of transistors, which reliably distinguish between roughly two voltage states (on and off) far more easily and cheaply than they could distinguish ten distinct voltage levels for decimal. Every layer of abstraction above that — hex, decimal, even the text you're reading right now — is ultimately represented as patterns of these two physical states, which is why binary remains the actual language of hardware even though humans work in hex or decimal for convenience.
A Fast Trick for Hex-to-Binary Conversion
Because each hex digit maps to exactly 4 binary bits, you can convert hex to binary digit-by-digit without doing any actual math: just memorize the 16 four-bit patterns (0=0000, 1=0001, ... F=1111) and substitute each hex character directly. Converting FF5733 becomes a simple lookup: F=1111, F=1111, 5=0101, 7=0111, 3=0011, 3=0011, giving the binary string directly — no division or remainder calculation needed, which is why programmers often convert through hex as an intermediate step rather than working with binary or decimal directly.
Unix File Permissions in Octal
When you run chmod 755, that is octal: 7 meaning read, write and execute for owner; 5 meaning read and execute for group; 5 meaning read and execute for others. Each digit maps to 3 binary bits.
Quick Conversion Reference
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 00010000 | 10 | 20 |
| 255 | 11111111 | FF | 377 |
Convert Between Number Systems Free
Use the Anonymiz Number Base Converter. Enter a number in any base — binary, decimal, hex, or octal — and instantly see the equivalent in all others. No math required.


