Base-N Calculator | Convert & Calculate Across Bases
Convert numbers and execute arithmetic operations across arbitrary number bases from binary (base 2) to hexatrigesimal (base 36) with step-by-step polynomial expansion proofs and multi-base synchronization.
Base Conversion Parameters
Accepts digits 0-9 and letters A-Z
Mathematical Step-by-Step Derivation
Common Computing Bases Equivalence
Sync Matrix| Base System | Radix (b) | Represented Value |
|---|
Base-N Positional Numeral Conversion
A base-n (or radix-b) numeral system represents numerical quantities using b distinct alphanumeric symbols (0–9 and A–Z for bases up to 36). Converting from base b to decimal requires summing the product of each digit and its positional power bⁱ. Converting from decimal to base b utilizes repeated integer division with remainders.
Positional Radix System Principles
Every modern positional numeral system relies on a mathematical constant known as its radix (or base). The radix defines both the total number of unique symbols permitted in the alphabet and the exponential multiplier assigned to each consecutive position:
Value = dₙ₋₁ · bⁿ⁻¹ + ... + d₁ · b¹ + d₀ · b⁰ + d₋₁ · b⁻¹ + ... + d₋ₘ · b⁻ᵐ
For any base $b$, the allowable digits are strictly integers in the range $0 \le d < b$. When $b > 10$, standard mathematics and computer science adopt Latin letters in alphabetical sequence:
Universal Conversion Formulas
Direct conversion between two arbitrary non-decimal bases (e.g. from Base 7 to Base 13) is universally executed using Decimal (Base 10) as the standardized mathematical bridge:
Base X → Decimal (Base 10)
Expand each digit by powers of the source radix:
Evaluate all multiplications and additions in standard decimal arithmetic.
Decimal → Target Base Y
Successively divide the decimal integer by target radix Y:
Collect remainders in reverse order from the final division to the first.
Step-by-Step Worked Examples
Example 1: Binary (Base 2) to Decimal (Base 10)
Convert the binary byte 11010110₂ to decimal:
11010110₂ = (1×2⁷) + (1×2⁶) + (0×2⁵) + (1×2⁴) + (0×2³) + (1×2²) + (1×2¹) + (0×2⁰)
= 128 + 64 + 0 + 16 + 0 + 4 + 2 + 0
= 214₁₀
Example 2: Decimal (Base 10) to Hexadecimal (Base 16)
Convert 1492₁₀ to hexadecimal via successive division by 16:
• 1492 ÷ 16 = 93 remainder 4 (Digit '4')
• 93 ÷ 16 = 5 remainder 13 (Digit 'D', since 13 = D)
• 5 ÷ 16 = 0 remainder 5 (Digit '5')
Reading remainders from bottom to top: 5D4₁₆
Example 3: Octal (Base 8) to Binary (Base 2) via Direct Grouping
Because $8 = 2^3$, each octal digit maps directly to an exact 3-bit binary triplet:
Convert 754₈ → 7 = 111₂, 5 = 101₂, 4 = 100₂
Concatenating triplets: 754₈ = 111101100₂
Base-N Arithmetic: Addition & Subtraction
Arithmetic inside any base $b$ functions according to identical elementary place-value axioms as base 10, adjusted for the carrying and borrowing threshold $b$:
Base-N Addition (Carrying Rule)
When column sum S = d₁ + d₂ + c_in ≥ b:
Carry to Left = ⌊S / b⌋
Example in Hex (b=16): 9 + B = 9 + 11 = 20 → 20 - 16 = 4 with carry 1 → 14₁₆.
Base-N Subtraction (Borrowing Rule)
When minuend digit $d_1 < d_2$:
Effective Value = d_1 + b
Example in Binary (b=2): 10₂ - 1₂ = 2 - 1 = 1₂. Borrowing transfers exactly +2 to the current column.
Comparative Table of Bases 2 to 36
Reference breakdown of key positional numbering radices utilized in mathematics, computing, and electronic engineering:
| Base Name | Radix (b) | Permitted Symbols | Typical Industry Application |
|---|---|---|---|
| Binary | 2 | 0, 1 | Digital microprocessors, logic gates, memory cells |
| Octal | 8 | 0 – 7 | UNIX file permissions (e.g. chmod 755), legacy aviation |
| Decimal | 10 | 0 – 9 | Human accounting, standard SI metric measurements |
| Duodecimal | 12 | 0 – 9, A, B | Timekeeping (12 hours), dozens, imperial units (12 inches) |
| Hexadecimal | 16 | 0 – 9, A – F | HTML/CSS colors (#FFFFFF), MAC/IPv6 addresses, memory dumps |
| Vigesimal | 20 | 0 – 9, A – J | Mayan calendar numbering, historical linguistic counting |
| Base 32 | 32 | 0 – 9, A – V | Case-insensitive RFC 4648 serialization, Geohashes |
| Hexatrigesimal | 36 | 0 – 9, A – Z | URL shorteners, compact alphanumeric identifiers, licenses |
Fractional & Radix Point Conversions
Converting numbers with fractional parts (digits to the right of the radix point) employs negative powers of the radix for expansion, and repeated multiplication for encoding:
Example: Convert 0.375₁₀ to Binary (Base 2)
Multiply the fractional remainder successively by target radix 2:
• 0.375 × 2 = 0.75 → First fractional digit is 0
• 0.75 × 2 = 1.50 → Second fractional digit is 1
• 0.50 × 2 = 1.00 → Third fractional digit is 1 (Remainder 0, terminates)
Reading top-to-bottom: 0.375₁₀ = 0.011₂
Floating-Point Invariance Caution: A fraction that terminates cleanly in decimal (like 0.1₁₀ or 0.2₁₀) may produce an infinite repeating sequence in binary (0.1₁₀ = 0.000110011...₂), which is the underlying cause of floating-point rounding imprecision in software engineering.
Common Mistakes in Base Conversion
1. Using Out-of-Range Digits for the Radix
Writing 185₈ or 102₂ is invalid. In base 8, the maximum valid digit is 7; in base 2, it is 1. Digits must always satisfy $d < b$.
2. Reading Division Remainders in the Wrong Direction
When converting from decimal using repeated division, the first remainder calculated represents the lowest-order digit (units place, $b^0$). You must read remainders in reverse order (bottom to top).
3. Forgetting Zero Placeholders in Grouping Shortcuts
When converting Hex to Binary, each hex digit must expand to exactly 4 binary bits. For example, 1B₁₆ → 1 becomes 0001 and B becomes 1011. Omitting leading zeros in internal chunks creates corrupt bitstreams.
Real-World Applications in Computer Science
Base-n conversion is the computational glue that bridges human-readable decimal math with hardware-level binary electronics:
Computer Memory & Hex Dumps
Hexadecimal is used to represent raw binary byte arrays compactly (2 hex digits = 1 full byte, 00 to FF), vastly simplifying memory address debugging.
Networking & MAC Addresses
Network hardware physical identifiers (MAC addresses like 00:1A:2B:3C:4D:5E) and 128-bit IPv6 headers are standardized in hexadecimal base-16 notation.
Web Colors & Styling
Every digital display screen maps Red, Green, and Blue subpixel channels using 8-bit hex codes from #000000 (black) to #FFFFFF (full white).
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.