Universal Number Base Converter

Convert numbers between any number bases from 2 to 36. Master binary, octal, decimal, hexadecimal, and exotic bases like base-36. Essential for computer science, mathematics, and understanding positional numeral systems.

Any Base 2-36
Universal Converter
Computer Science
Mathematics

Universal Number Base Converter

Convert numbers between any bases from 2 to 36

Valid characters: 0123456789

Quick Examples

Common Base Equivalents

Decimal 255

Binary: 11111111
Octal: 377
Hex: FF

Decimal 16

Binary: 10000
Octal: 20
Hex: 10

Powers of 2

2¹ = 2 = 10₂
2⁴ = 16 = 10₁₆
2⁸ = 256 = 100₁₆

Base 36 Max

Z = 35₁₀
ZZ = 1295₁₀
ZZZ = 46655₁₀

Understanding Positional Number Systems

Learn the mathematical foundation of number bases

A positional numeral system (or place-value notation) is a method of representing numbers where the position of each digit determines its value. The base (or radix) defines how many unique digits are used. For example, decimal (base-10) uses 10 digits (0-9), while binary (base-2) uses only 2 digits (0-1).

Common Number Bases

Base 2 (Binary)0, 1
Base 8 (Octal)0-7
Base 10 (Decimal)0-9
Base 12 (Duodecimal)0-9, A, B
Base 16 (Hex)0-9, A-F
Base 360-9, A-Z

Base Conversion Formula

To Decimal:
Σ(digit × base^position)
From Decimal:
Repeated division by base
Example (Base 3 → Decimal):
201₃ = (2×3²)+(0×3¹)+(1×3⁰) = 18+0+1 = 19₁₀

Historical Development of Number Systems

Explore how different civilizations developed various number bases

Different civilizations throughout history have used various number bases based on practical considerations, cultural factors, and available counting methods. Understanding these historical systems provides insight into why we use certain bases today.

Base 60 (Sexagesimal)

Used by ancient Babylonians and still present in our time system (60 seconds, 60 minutes) and angular measurements (360 degrees).

1 hour = 60 minutes
1 minute = 60 seconds
Circle = 360° (6×60)

Base 20 (Vigesimal)

Used by Maya, Aztecs, and Celtic cultures. Based on counting with fingers and toes (20 total digits).

French: quatre-vingts (4×20)
Maya: Advanced calendar system
Score = 20 (biblical reference)

Base 12 (Duodecimal)

Highly divisible (factors: 1,2,3,4,6,12), used in measurements like dozen, gross, and imperial units.

1 dozen = 12 items
1 foot = 12 inches
1 gross = 144 (12²)

Modern Applications

Discover where different number bases are used today

Computer Programming

Binary for machine code, hex for memory addresses and color codes, octal for Unix permissions. Base-64 encoding for data transmission and storage in web applications.

0xFF00FF → Purple color (#FF00FF)

Web Development

URL encoding uses base-36 for short links, CSS uses hex colors, base-64 for image encoding, and various bases for hash functions and unique identifier generation.

Base36: 2N9C → Shorter than decimal 123456

Mathematics Education

Teaching positional notation, place value concepts, and mathematical foundations. Helps students understand how our decimal system is just one of many possible systems.

321₄ = 3×16 + 2×4 + 1×1 = 57₁₀

Cryptography

Large prime numbers in various bases, hash functions, encryption keys, and digital signatures. Base conversion is essential for cryptographic algorithms and key generation.

RSA keys often represented in hex

Data Storage

Efficient data encoding, file formats, compression algorithms, and database optimizations. Different bases provide varying levels of compression and human readability.

Base64: Encode binary data for text protocols

Scientific Computing

Numerical analysis, scientific notation, and specialized number systems for specific domains like astronomy, chemistry, and physics calculations.

Binary for Boolean algebra and logic

Advanced Conversion Techniques

Master efficient methods for base conversion

Direct Power-of-2 Conversion

For bases that are powers of 2 (2, 4, 8, 16, 32), you can convert directly without going through decimal.

Binary ↔ Hexadecimal

1111 0110 1010 0001₂
F 6 A 1₁₆
Group by 4 bits → Direct mapping

Binary ↔ Octal

101 110 101₂
5 6 5₈
Group by 3 bits → Direct mapping

Horner's Method

Efficient algorithm for converting from any base to decimal, reducing the number of operations required.

Example: 1A3₁₆ to Decimal

Standard: 1×16² + 10×16¹ + 3×16⁰
Horner's: ((1×16 + 10)×16 + 3)
= (26×16 + 3) = 416 + 3 = 419

Algorithm Steps

1. Start with leftmost digit
2. Multiply by base, add next digit
3. Repeat until all digits processed

Frequently Asked Questions

Common questions about number base conversion

What's the highest number base this converter supports?

Our converter supports bases from 2 to 36. Base 36 uses digits 0-9 and letters A-Z, giving 36 unique symbols. This is the practical limit for alphanumeric representation, though mathematically, any base is possible.

Why do computers use binary, octal, and hexadecimal?

Binary (base-2) matches how computers store data (on/off states). Octal (base-8) and hexadecimal (base-16) are convenient because they're powers of 2 (2³=8, 2⁴=16), making conversion to/from binary straightforward. Hex is especially popular because each hex digit represents exactly 4 binary digits.

How do I convert between non-decimal bases directly?

The easiest method is to convert through decimal as an intermediate step: Source Base → Decimal → Target Base. For bases that are powers of each other (like binary↔octal or binary↔hex), you can group digits directly without going through decimal.

What characters are used for digits greater than 9?

For bases higher than 10, letters are used: A=10, B=11, C=12, and so on up to Z=35. This allows base-36 to use all digits 0-9 and letters A-Z. The converter accepts both uppercase and lowercase letters.

Can I convert fractional numbers between bases?

Our current converter focuses on whole numbers (integers). Converting fractional parts between bases requires additional algorithms and can sometimes result in repeating decimals. For most practical applications, integer conversion covers the majority of use cases.

What's the practical limit for number size?

The converter can handle very large numbers, limited by JavaScript's number precision (about 15-16 significant digits). For cryptographic applications requiring larger numbers, specialized libraries with arbitrary precision arithmetic would be needed.