🔢 Number Base Converter

Convert between Binary, Decimal, Hexadecimal, and Octal

📥 Input Number

Enter a valid number in the selected base

📊 Conversion Results

Binary (Base 2)

101010

Octal (Base 8)

52

Decimal (Base 10)

42

Hexadecimal (Base 16)

2A

Conversion Reference Table (0-15)

Decimal Binary Octal Hexadecimal

📚 Understanding Number Bases

What are Number Bases?

A number base (or radix) is the number of unique digits used to represent numbers in a positional numeral system. Different bases are used for different purposes in mathematics, computing, and everyday life.

Binary (Base 2)

Uses only 0 and 1. Each digit represents a power of 2. Binary is the fundamental language of computers and digital electronics.

Example: 1010₂ = (1×2³) + (0×2²) + (1×2¹) + (0×2⁰) = 8 + 0 + 2 + 0 = 10₁₀

Octal (Base 8)

Uses digits 0-7. Each digit represents a power of 8. Often used as a shorthand for binary in computing, especially in Unix file permissions.

Example: 52₈ = (5×8¹) + (2×8⁰) = 40 + 2 = 42₁₀

Decimal (Base 10)

Uses digits 0-9. The standard number system humans use daily. Each digit represents a power of 10.

Example: 365₁₀ = (3×10²) + (6×10¹) + (5×10⁰) = 300 + 60 + 5

Hexadecimal (Base 16)

Uses digits 0-9 and letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). Commonly used in programming for colors, memory addresses, and compact binary representation.

Example: 2A₁₆ = (2×16¹) + (10×16⁰) = 32 + 10 = 42₁₀

Quick Conversion Tips

Frequently Asked Questions

Why do computers use binary?

Computers use binary because digital circuits can easily represent two states: on (1) and off (0). This makes binary the most reliable and efficient system for electronic computing. All data in computers, from text to images, is ultimately stored and processed as binary numbers.

When should I use hexadecimal instead of binary?

Hexadecimal is more compact and easier to read than binary. Use hex when you need to represent binary data in a human-readable format, such as color codes (#FF5733), memory addresses, or debugging. One hex digit represents exactly four binary digits, making conversion straightforward.

What is octal used for today?

Octal is primarily used in Unix/Linux file permissions (e.g., chmod 755) and some legacy systems. While less common than hex, it's still useful because three binary digits convert to one octal digit, making it a compact representation for certain applications.

How do I convert between bases manually?

To convert from any base to decimal: multiply each digit by the base raised to its position power (starting from 0 on the right), then sum. To convert from decimal to another base: repeatedly divide by the target base and record remainders in reverse order. For binary-hex-octal conversions, use grouping methods.

What's the largest number I can convert?

This calculator can handle very large numbers limited only by JavaScript's number precision (up to 2^53 - 1 or about 9 quadrillion). For even larger numbers, you may need specialized big integer libraries. The conversion algorithms work the same regardless of size.

Can I convert negative numbers or decimals?

This calculator handles positive integers. Negative numbers in computers use two's complement representation in binary. Decimal fractions require different conversion methods (multiplying by the base for the fractional part). For these special cases, use specialized calculators or conversion methods.