Understanding Number Base Systems
A number base (also called radix) determines how many unique digits are used to represent numbers. Our everyday decimal system uses base 10 with digits 0-9. Computers use binary (base 2) with just 0 and 1. Different bases have developed throughout history and serve various purposes in mathematics, computing, and culture.
This universal converter supports any base from 2 to 36. Bases above 10 use letters A-Z to represent values 10-35. For example, in hexadecimal (base 16), A=10, B=11, through F=15. In base 36, Z represents 35.
Digit Values for Higher Bases
0-9 = 0-9 (same as decimal)
A-F = 10-15 (used in hex and above)
G-Z = 16-35 (used in bases 17-36)
Common Number Base Systems
Binary (Base 2)
Binary is the foundation of all digital computing. Using only 0 and 1, it directly represents the on/off states of electronic switches. Every piece of digital data—from text and images to videos and software—is ultimately stored and processed as binary. While humans rarely work directly in binary, understanding it is fundamental to computer science.
Digits: 0, 1
Example: 1010₂ = 10₁₀
Ternary (Base 3)
Ternary uses three digits: 0, 1, and 2. While not common in modern computing, ternary has theoretical advantages. Balanced ternary (using -1, 0, +1) was used in some early Soviet computers like the Setun. Some researchers believe ternary computing could offer efficiency benefits over binary.
Digits: 0, 1, 2
Example: 102₃ = 11₁₀
Quaternary (Base 4)
Quaternary is particularly relevant in genetics, where the four DNA nucleotides (A, T, G, C) can be represented as quaternary digits. It also appears in some indigenous counting systems and has applications in data compression.
Digits: 0, 1, 2, 3
Example: 123₄ = 27₁₀
Octal (Base 8)
Octal uses digits 0-7, with each digit representing exactly three binary bits. It was historically important in computing when machines used word sizes divisible by 3. Today, octal is primarily used for Unix/Linux file permissions (e.g., chmod 755).
Digits: 0-7
Example: 755₈ = 493₁₀
Decimal (Base 10)
Decimal is the standard human number system, likely developed because humans have ten fingers. It's used universally for everyday counting, commerce, and most non-technical applications. While intuitive for humans, decimal doesn't align well with binary computing.
Digits: 0-9
Example: 255₁₀ = 255₁₀
Duodecimal (Base 12)
Duodecimal (also called dozenal) has advocates who argue it's superior to decimal due to its divisibility. 12 divides evenly by 2, 3, 4, and 6, making fractions simpler. We see remnants in our 12-hour clocks, 12-inch feet, and 12-item dozens. Some mathematicians propose switching to base 12.
Digits: 0-9, A (10), B (11)
Example: 100₁₂ = 144₁₀
Hexadecimal (Base 16)
Hexadecimal is the dominant base in computing after binary and decimal. Each hex digit represents exactly four binary bits (one nibble), making it perfect for representing bytes (two hex digits). It's used for memory addresses, color codes (#FF0000), MAC addresses, and debugging.
Digits: 0-9, A-F
Example: FF₁₆ = 255₁₀
Vigesimal (Base 20)
Vigesimal counting systems developed in cultures that counted using both fingers and toes. The Maya civilization used a sophisticated vigesimal system. Traces remain in languages: French "quatre-vingts" (80 = 4×20) and Danish number words reflect vigesimal origins.
Digits: 0-9, A-J
Example: 100₂₀ = 400₁₀
Base 32
Base 32 encoding is used in computing for representing binary data in a human-readable format. It's more compact than hexadecimal while avoiding confusing characters. Applications include Crockford's Base32, z-base-32, and various data encoding schemes.
Digits: 0-9, A-V
Example: 100₃₂ = 1024₁₀
Base 36
Base 36 uses all digits 0-9 and all letters A-Z, making it the highest base using standard alphanumeric characters. It's commonly used for generating short unique identifiers, URL shorteners, and compact numeric representations in databases.
Digits: 0-9, A-Z
Example: ZZ₃₆ = 1295₁₀
Quick Reference Table
| Decimal | Binary | Octal | Hex | Base 36 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 10 | 1010 | 12 | A | A |
| 16 | 10000 | 20 | 10 | G |
| 36 | 100100 | 44 | 24 | 10 |
| 100 | 1100100 | 144 | 64 | 2S |
| 255 | 11111111 | 377 | FF | 73 |
| 1000 | 1111101000 | 1750 | 3E8 | RS |
| 65535 | 1111111111111111 | 177777 | FFFF | 1EKF |
How Base Conversion Works
Converting to Decimal (Base 10)
To convert any number to decimal, multiply each digit by its positional value (base raised to the position power) and sum the results. Positions start at 0 from the right.
Example: Convert 1A3₁₆ to decimal
Position values: 1×16² + A×16¹ + 3×16⁰
= 1×256 + 10×16 + 3×1
= 256 + 160 + 3 = 419
Converting from Decimal to Any Base
Repeatedly divide by the target base and collect remainders. Read the remainders from bottom to top (last to first) to get the result.
Example: Convert 419 to hexadecimal
419 ÷ 16 = 26 remainder 3
26 ÷ 16 = 1 remainder 10 (A)
1 ÷ 16 = 0 remainder 1
Reading bottom to top: 1A3₁₆
Converting Between Non-Decimal Bases
The easiest method is to first convert to decimal, then convert from decimal to the target base. While direct conversion algorithms exist, the two-step approach is simpler and less error-prone.
Applications of Different Bases
Computing and Technology
- Binary: All digital electronics, processors, memory
- Octal: Unix permissions, some legacy systems
- Hexadecimal: Memory addresses, color codes, debugging
- Base 32/64: Data encoding, URLs, cryptographic hashes
Mathematics and Science
- Ternary: Balanced ternary in theoretical computing
- Quaternary: DNA sequence representation
- Sexagesimal (60): Time and angle measurements (inherited from Babylon)
Cultural and Historical
- Quinary (5): Tally marks, some indigenous counting
- Duodecimal (12): Time (hours), imperial measurements
- Vigesimal (20): Mayan numerals, Celtic languages
- Sexagesimal (60): Babylonian mathematics, still used in time/angles
Base Conversion Formulas
General Formula: Base N to Decimal
For a number dndn-1...d1d0 in base N:
Value = dn×Nn + dn-1×Nn-1 + ... + d1×N1 + d0×N0
Decimal to Base N Algorithm
- Divide the number by N
- Record the remainder
- Replace the number with the quotient
- Repeat until the quotient is 0
- Read remainders in reverse order
Frequently Asked Questions
Why can't bases go higher than 36?
Base 36 uses all digits 0-9 and letters A-Z. Going higher would require additional symbols beyond the standard alphanumeric set. While higher bases are theoretically possible, they're rarely practical. Base 64 encoding uses a custom symbol set including + and /.
What's the most efficient base?
Mathematically, base e (approximately 2.718) is the most efficient for representing numbers. In practice, base 3 is the closest integer and has theoretical advantages. However, binary dominates computing due to the simplicity of two-state electronics.
Why do we use decimal (base 10)?
Humans likely adopted base 10 because we have ten fingers. Many cultures independently developed decimal systems. While base 12 has mathematical advantages, base 10 became the global standard through widespread adoption.
How do I know which base a number is in?
Context usually determines the base. In programming, prefixes indicate the base: 0b for binary, 0o for octal, 0x for hexadecimal. In mathematics, subscripts are used: 1010₂ (binary), 52₈ (octal), 2A₁₆ (hex). Without notation, assume decimal.
Can I convert fractional numbers between bases?
Yes, though it's more complex. The integer part converts normally. For the fractional part, repeatedly multiply by the target base and take the integer portion of each result. Some fractions that terminate in one base may be infinite in another.