EasyUnitConverter.com

Base Converter

Convert numbers between any base from 2 to 36 or use our Binary to Decimal converter.

11111111

How Number Base Conversion Works

A number base (or radix) defines how many unique digits a number system uses. Base-10 (decimal) uses digits 0–9, base-2 (binary) uses 0–1, base-8 (octal) uses 0–7, and base-16 (hexadecimal) uses 0–9 plus A–F. Bases above 16 extend the digit set further through the alphabet: base-36 uses 0–9 and A–Z, giving 36 unique symbols. To convert between any two bases, the standard approach is to first convert the source number to base-10 (decimal), then convert from base-10 to the target base.

Base Conversion Formula

To convert from base-b to decimal: Decimal = dₙ×bⁿ + dₙ₋₁×bⁿ⁻¹ + ... + d₁×b¹ + d₀×b⁰, where dᵢ is the value of each digit and b is the source base. To convert from decimal to base-t: repeatedly divide the decimal number by t and collect the remainders in reverse order. Each remainder becomes a digit in the target base (using A=10, B=11, ... Z=35 for digits above 9).

Worked Example: Convert 255 (Base-10) to Base-16

Step 1: Divide 255 by 16: quotient = 15, remainder = 15 (F). Step 2: Divide 15 by 16: quotient = 0, remainder = 15 (F). Step 3: Read remainders bottom-to-top: FF. So 255₁₀ = FF₁₆. Verification: F×16¹ + F×16⁰ = 15×16 + 15×1 = 240 + 15 = 255 ✓. Another example: 100₁₀ to base-8: 100 ÷ 8 = 12 R4, 12 ÷ 8 = 1 R4, 1 ÷ 8 = 0 R1 → 144₈.

Common Number Bases in Computing

Base-2 (Binary): The foundation of all digital computing. Each digit is a bit (0 or 1). Used in CPU instructions, memory addressing, and logic gates. Base-8 (Octal): Groups of 3 binary digits. Used in Unix file permissions (chmod 755) and some legacy systems. Base-10 (Decimal): The standard human number system. Used in everyday arithmetic and most user-facing applications. Base-16 (Hexadecimal): Groups of 4 binary digits. Used for memory addresses, color codes (#FF5733), MAC addresses, and byte-level data representation. Base-36: Maximum alphanumeric base using 0–9 and A–Z. Used in URL shorteners and compact ID encoding.

Technical Details

This converter supports any integer base from 2 to 36. For bases above 10, letters A through Z represent digit values 10 through 35. The conversion is performed using JavaScript's built-in parseInt() for source-to-decimal and Number.toString() for decimal-to-target, both of which support bases 2–36 natively. Input is case-insensitive (ff and FF are both valid hexadecimal). The tool handles integers only — fractional base conversion requires a different algorithm involving repeated multiplication.

Frequently Asked Questions

What is a number base? A number base (radix) is the number of unique digits used in a positional number system. Base-10 uses ten digits (0–9), base-2 uses two (0–1), and so on. Why is hexadecimal used in computing? Because each hex digit maps to exactly 4 binary bits, making it a compact and readable way to represent binary data. One byte (8 bits) is always exactly 2 hex digits. What is the highest base this tool supports? Base-36, which uses digits 0–9 and letters A–Z. This is the maximum for single-character digit representation. Can I convert between two non-decimal bases directly? Yes — this tool converts between any two bases. Internally it converts through decimal as an intermediate step, but the result is the same as a direct conversion.

Solved Examples

Example 1: A programmer needs to convert the hexadecimal memory address 1A3F to binary. Convert hex to decimal: 1×16³ + A(10)×16² + 3×16¹ + F(15)×16⁰ = 4096 + 2560 + 48 + 15 = 6719. Convert to binary: 6719 → 1101000111111. Or use the shortcut: 1=0001, A=1010, 3=0011, F=1111 → 0001101000111111₂. Example 2: Convert 177 in base-8 (octal) to base-10. 1×8² + 7×8¹ + 7×8⁰ = 64 + 56 + 7 = 127. Example 3: Express 500 in base-10 as base-5. 500÷5=100 R0, 100÷5=20 R0, 20÷5=4 R0, 4÷5=0 R4 → 4000₅. Verify: 4×125 = 500 ✓. Example 4: Convert base-3 number "2102" to decimal. 2×3³ + 1×3² + 0×3¹ + 2×3⁰ = 54 + 9 + 0 + 2 = 65.

Practice Questions

1. Convert 1010110₂ (binary) to decimal. (Answer: 86) 2. Convert 200₁₀ to base-8 (octal). (Answer: 310) 3. What is 7F₁₆ in decimal? (Answer: 127) 4. Convert 1000₁₀ to base-16. (Answer: 3E8) 5. Express 45₁₀ in base-2. (Answer: 101101) 6. Convert ABC₁₆ to decimal. (Answer: 2748)

Common Mistakes to Avoid

The most common error in base conversion is using digits that don't exist in the specified base. For example, entering "82" as a base-8 number is invalid because octal only uses digits 0–7. Another frequent mistake is reading the remainders in the wrong order when converting from decimal — remainders must be read from bottom to top (last remainder is the most significant digit). Students also frequently confuse the direction of conversion: multiplying when they should divide, or vice versa. When working with hexadecimal, remember that A=10, B=11, C=12, D=13, E=14, F=15 — mixing up these letter values leads to incorrect results. Finally, forgetting to pad binary groups when converting to hex or octal causes misalignment: the leftmost group may need leading zeros.

Key Takeaways

Every positional number system works on the same principle — each digit position represents a power of the base. To convert TO decimal: multiply each digit by base^position and sum. To convert FROM decimal: repeatedly divide by target base and collect remainders in reverse. Binary ↔ Hex shortcut: 4 binary digits = 1 hex digit. Binary ↔ Octal shortcut: 3 binary digits = 1 octal digit. Base-36 is the maximum single-character-per-digit base (0–9 + A–Z). Always verify your conversion by converting back — if you get the original number, your conversion is correct.

Related Converters: