How to Convert Between Binary, Decimal, Hexadecimal & Octal
September 5, 2026 · 5 min read
Computers think in binary. Programmers think in decimal. Memory addresses use hexadecimal. File permissions use octal. Understanding how to convert between these number systems is a foundational skill for anyone working with computers at a technical level.
Why Different Bases Exist
Binary (base 2) is how computers actually store and process data — everything is 0s and 1s. Decimal (base 10) is how humans naturally count. Hexadecimal (base 16) is a compact way to represent binary — each hex digit represents exactly 4 binary digits. Octal (base 8) represents 3 binary digits and is used for Unix file permissions.
Binary to Decimal
Each binary digit represents a power of 2 from right to left: 1, 2, 4, 8, 16, 32, 64, 128. The binary number 11010110 = 128+64+16+4+2 = 214 in decimal. Add up the values where the binary digit is 1, skip where it is 0.
Hexadecimal Essentials
Hex uses digits 0-9 plus letters A-F (10-15). The hex number FF = 15×16 + 15 = 255 in decimal. Colors use hex because each channel (R, G, B) ranges from 0 to 255, which is 00 to FF in hex. Memory addresses use hex because it is much more compact than binary: FF is easier to read than 11111111.
Practical Applications
Web colors: #0D9488 is three hex pairs representing RGB. File permissions: chmod 755 means owner rwx (7=111), group rx (5=101), others rx (5=101). IP addresses: internally stored as 32-bit binary numbers. MAC addresses: displayed as hex pairs separated by colons. Understanding these conversions makes you a more effective developer.
Try It Now
Our free Base64 Encoder handles this instantly — no signup, no limits.
Open Base64 Encoder →Also useful: our Regex Tester for related calculations.