Number Base Converter: The Complete Guide to Binary, Decimal, Octal & Hexadecimal
Every number you see on a screen is ultimately represented in binary — ones and zeros — at the hardware level. But humans work with different number systems depending on the context: decimal for everyday math, hexadecimal for programming, octal for file permissions, and binary for understanding how computers actually work.
A number base converter lets you translate between these systems instantly. This guide explains how each number system works, how to convert between them, and where you'll encounter them in real life.
🔄 Free Number Base ConverterUnderstanding Number Bases (Radix)
A number base defines how many unique symbols are used to represent values and how place values work. In decimal (base-10), each position represents a power of 10. In binary (base-2), each position represents a power of 2.
The four most common number systems in computing are:
| System | Base | Digits | Common Use |
|---|---|---|---|
| Binary | 2 | 0, 1 | Computer architecture, networking |
| Octal | 8 | 0-7 | Unix file permissions, legacy systems |
| Decimal | 10 | 0-9 | Everyday arithmetic |
| Hexadecimal | 16 | 0-9, A-F | Programming, web colors, memory |
How Number Bases Work
Let's see how the number 255 is represented in each base:
- Decimal (base-10): 255 = 2×10² + 5×10¹ + 5×10⁰
- Binary (base-2): 11111111 = 1×2⁷ + 1×2⁶ + 1×2⁵ + 1×2⁴ + 1×2³ + 1×2² + 1×2¹ + 1×2⁰
- Octal (base-8): 377 = 3×8² + 7×8¹ + 7×8⁰
- Hexadecimal (base-16): FF = 15×16¹ + 15×16⁰
All four represent the same value — 255 — just using different bases. The number base converter handles these translations instantly.
Conversion Methods
Decimal to Binary
Repeatedly divide by 2, recording remainders from bottom to top:
42 ÷ 2 = 21 remainder 0
21 ÷ 2 = 10 remainder 1
10 ÷ 2 = 5 remainder 0
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Result: 101010
Binary to Decimal
Multiply each digit by 2 to the power of its position (starting from 0 on the right):
101010 = 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1
= 32 + 8 + 2 = 42
Decimal to Hexadecimal
Same method as binary, but divide by 16:
255 ÷ 16 = 15 remainder 15 (F)
15 ÷ 16 = 0 remainder 15 (F)
Result: FF
Decimal to Octal
Divide by 8 and collect remainders:
255 ÷ 8 = 31 remainder 7
31 ÷ 8 = 3 remainder 7
3 ÷ 8 = 0 remainder 3
Result: 377
Binary to Hex (and Vice Versa)
Group binary digits into sets of 4 (from the right), then convert each group to its hex equivalent:
Binary: 1101 0111 1010
D 7 A
Result: 0xD7A
Real-World Applications
Binary — The Foundation of Computing
Every piece of data in a computer — text, images, videos, programs — is stored as binary. Subnet masks in networking (like 255.255.255.0 or /24) are based on binary bit patterns. Understanding binary is essential for anyone working with computers at a low level.
Hexadecimal — The Programmer's Shortcut
Since each hex digit maps to exactly 4 binary bits, hexadecimal is the most practical way to represent binary data. Uses include:
- Memory addresses in debuggers and crash logs
- CSS color codes (
#6366F1) - Unicode character references (e.g., U+0041 for 'A')
- MAC addresses and network protocols
Octal — Unix Permissions
The most common everyday use of octal is Unix/Linux file permissions. When you run chmod 755 file.sh, the 755 is octal: 7 (rwx) for owner, 5 (r-x) for group, 5 (r-x) for others. Each digit is a 3-bit binary representation of read (4), write (2), and execute (1) permissions.
Beyond the Common Bases
While binary, octal, decimal, and hex are the most common, other bases appear in specialized contexts:
- Base-64: Used for encoding binary data in text (email attachments, data URLs, API payloads)
- Base-32: Used in encoding systems that need to be case-insensitive (e.g., some TOTP authenticator codes)
- Base-36: Uses digits 0-9 and letters A-Z for compact numeric representation
- Base-58: Used in Bitcoin addresses, excluding easily-confused characters (0/O, 1/I/l)
Tips for Learning Number Base Conversion
- Start with binary-to-decimal: This is the most fundamental conversion. Master it before moving to other bases.
- Memorize powers of 2: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. These come up constantly.
- Use the grouping trick: Binary → Hex (groups of 4), Binary → Octal (groups of 3). No math required.
- Practice with the converter tool: Verify your manual calculations.
- Learn hex colors: If you do any web work, CSS hex colors are a great way to build intuition.
Related Tools
- Hexadecimal Calculator — Perform hex arithmetic and conversions
- Binary Converter — Convert between binary, text, and decimal
- Text to Binary Converter — Encode any text into binary representation