Binary, Hex, and Octal: A Plain-English Guide to Number Base Conversion
Every computer on the planet stores data in binary — ones and zeros — yet humans work in decimal. Hexadecimal colors fill CSS stylesheets, IP addresses are written in dotted decimal, and memory addresses appear in hex. Understanding how to move between these number systems is one of those skills that demystifies a huge chunk of what computers actually do, and it's simpler than it looks once you see the pattern.
Why Different Number Bases Exist
Humans settled on base-10 (decimal) because we have ten fingers. Computers use base-2 (binary) because transistors are either on or off. Programmers use base-16 (hexadecimal) because it maps perfectly to binary — four bits equal exactly one hex digit — making it a compact human-readable shorthand for raw binary data. Base-8 (octal) used to appear in early Unix file permissions (chmod 755), where three bits map to one octal digit.
Binary: The Foundation
Binary only has two digits: 0 and 1. Each position in a binary number represents a power of 2, starting from 2⁰ = 1 on the right. To convert binary 1011 to decimal, multiply each bit by its positional value and sum: (1×8) + (0×4) + (1×2) + (1×1) = 11. Going the other direction, repeatedly divide by 2 and record the remainders — reading them bottom-up gives you the binary representation.
Hexadecimal: Binary's Shorthand
Hexadecimal uses 16 symbols: 0–9 for values zero through nine, then A–F for ten through fifteen. The reason designers and developers love hex is that every two hex digits encode exactly one byte (8 bits). The CSS color #FF5733 is three bytes — FF (red = 255), 57 (green = 87), 33 (blue = 51) — packed into six readable characters. To convert hex to decimal, multiply each digit by the corresponding power of 16. To go decimal to hex, divide repeatedly by 16 and map remainders above 9 to letters.
Octal: Unix's Legacy
Octal (base-8) uses digits 0–7 and appears most often in Unix-style file permissions. A permission of 755 means the owner has 7 (read + write + execute), and group and others each have 5 (read + execute). Each octal digit maps directly to three binary bits, making it a convenient shorthand that predates hex in systems programming. Conversion follows the same pattern as binary: each position is a power of 8.
Quick Mental Math Shortcuts
You don't always need to do the full conversion math. A few shortcuts save time daily: hex FF is always 255, 80 is 128, and 0F is 15. Binary 1000 0000 is always 128, and 1111 1111 is 255. Recognizing these anchor values lets you estimate conversions quickly without a calculator, which is handy when eyeballing memory addresses or bitmask values in code reviews.
Where Number Bases Appear in Real Work
Beyond CSS colors and permissions, you'll encounter number bases in many places: MAC addresses and IPv6 addresses use hex; bit flags and bitmasks in C and systems code live in binary; Unicode code points are often written as hex (U+1F600); color values in design tokens; and network subnets expressed in binary. Database engineers who inspect raw memory dumps need to read hex fluently. Frontend developers decode CSS colors. Every programmer eventually hits a moment where knowing your bases pays off.
Convert Instantly in Your Browser
Memorizing the algorithms is useful, but day-to-day you want instant results. Our Number Base Converter converts between binary, octal, decimal, and hexadecimal in real time — type in any base and all other representations update immediately. It runs entirely in your browser, so no data is sent anywhere and conversions happen instantly with no server round-trips.