Logarithms in any base — with step-by-step solutions and real-world context
Logarithms are one of the most powerful and widely used concepts in mathematics, science, engineering, and computing. The logarithm answers the fundamental question: 'To what power must I raise base b to get x?' Written as logb(x) = y, this means b raised to the power y equals x. Our free Log Calculator handles every common logarithm scenario — base-10 common logs, natural logs (base e), binary logs (base 2), arbitrary base logs, antilogs, change of base, and solving for any unknown variable. The three most commonly encountered logarithm bases each have a specific domain. The common logarithm (base 10) is the standard in science and engineering — it forms the backbone of the pH scale in chemistry, the decibel scale in acoustics and electronics, and the Richter magnitude scale in seismology. When scientists say 'a tenfold increase,' they are describing one unit on a base-10 logarithmic scale. The natural logarithm (base e, where e ≈ 2.71828) appears throughout calculus, physics, and finance. It arises naturally whenever a quantity grows or decays at a rate proportional to itself — population growth, radioactive decay, compound interest, and electrical charge and discharge all follow natural logarithm relationships. The binary logarithm (base 2) is fundamental in computer science and information theory. Every time you double or halve a quantity in computing — memory sizes, data encoding, algorithm complexity — binary logarithms describe the relationship. The number of bits required to represent n values is log2(n), which is why 8 bits represent 256 values (log2(256) = 8). Beyond these three standard bases, our calculator supports any positive base other than 1, enabling specialized applications such as base-8 (octal) used in older computing systems, base-16 (hexadecimal) for memory address calculations, and any custom base needed for academic problems or engineering calculations. The change-of-base feature lets you convert a logarithm in one base to an equivalent expression in another base — an essential tool when only certain bases are available on a calculator or programming environment. The antilogarithm is the inverse operation: given a base b and an exponent y, find x = b^y. This is essential when working backward from a logarithmic measurement to the original physical value. For example, if a sound is measured at 80 decibels, the antilog gives the actual intensity ratio; if a solution has a pH of 7.4, the antilog gives the hydrogen ion concentration. Our calculator also includes a powerful 'Solve for Variable' mode. In the equation logb(x) = y, if you know any two of the three variables (base b, argument x, or result y), this tool solves for the missing third. This covers scenarios like: 'What base gives me log(1000) = 3?' (answer: base 10), 'What argument satisfies log10(x) = 2.5?' (answer: approximately 316.23), or 'What is log5(125)?' (answer: 3). All calculations display a step-by-step solution using the change-of-base formula — logb(x) = ln(x) / ln(b) — which is the standard computational method used in programming languages and calculators. This transparency helps students understand not just the answer but the reasoning behind it. The comparison bar chart visually shows ln(x), log10(x), log2(x), and the custom base result simultaneously, making it easy to understand how the same number looks across different logarithmic scales. Real-world application panels translate your calculated result into concrete examples: decibel levels for audio intensity, Richter scale interpretation for seismic energy, and bit-depth requirements for digital information storage. Whether you are a student mastering logarithm properties, a scientist converting between measurement scales, an engineer calculating signal levels, or a programmer analyzing algorithm complexity, this calculator provides instant, accurate results with the context needed to understand them.
Understanding Logarithms
What Is a Logarithm?
A logarithm is the inverse of exponentiation. The expression logb(x) = y asks: 'To what power y must base b be raised to equal x?' This is equivalent to the exponential form b^y = x. For example, log10(1000) = 3 because 10^3 = 1000, and ln(e^2) = 2 because e^2 = e^2. The base b must always be positive and not equal to 1. The argument x must be positive — logarithms of zero or negative numbers are undefined in the real number system. Three bases are used most commonly: base 10 (common log), base e (natural log), and base 2 (binary log). Every other base can be computed using the change-of-base formula: logb(x) = ln(x) / ln(b).
How Are Logarithms Calculated?
Modern calculators and computers compute logarithms using the change-of-base formula: logb(x) = ln(x) / ln(b), where ln is the natural logarithm available as a native function. The natural logarithm itself is computed using convergent series expansions or hardware floating-point instructions. For the antilogarithm (inverse log), the formula is x = b^y, computed as Math.pow(b, y) or b**y in programming. To solve for an unknown base given x and y, use b = x^(1/y), which follows from the definition b^y = x. Change-of-base conversion is straightforward: logNewBase(x) = ln(x) / ln(newBase), regardless of the original base. All seven core logarithm properties — product, quotient, power, change-of-base, identity, zero, and inverse — follow directly from the exponential definition and can be verified algebraically.
Why Do Logarithms Matter?
Logarithms compress enormous ranges of values into manageable scales, making them indispensable across science and engineering. The decibel scale uses base-10 logarithms to represent sound intensities that span 12 orders of magnitude — from the threshold of hearing at 0 dB to a jet engine at 140 dB. The Richter scale similarly compresses earthquake energy so each whole-number increase represents 10 times more ground motion. The pH scale uses the negative log of hydrogen ion concentration to express acidity on a 0–14 scale. In finance, logarithms model compound growth and are central to options pricing (Black-Scholes model). In computer science, O(log n) algorithms — like binary search and balanced tree operations — are prized because they scale slowly even for massive datasets. In statistics, log transformations normalize skewed data and stabilize variance.
Important Limitations
Logarithms have strict domain restrictions: the argument x must be strictly positive (x > 0), and the base b must be positive and not equal to 1. Attempting to compute the log of zero or a negative number in the real-number domain is undefined (in complex analysis, logs of negative numbers do have solutions, but these are not real-valued). A base of 1 is also forbidden because 1 raised to any power always equals 1, making the equation 1^y = x have no solution for x ≠ 1. Additionally, floating-point arithmetic introduces small rounding errors for irrational results like ln(2) or log10(3). The calculator displays results to your chosen decimal precision, but the underlying values are IEEE 754 double-precision floating-point numbers. For scientific or engineering applications requiring more decimal places, consider a dedicated mathematical software package.
Key Logarithm Formulas
Common Logarithm
log₁₀(x) = ln(x) / ln(10)
The base-10 logarithm, used in decibels, pH, and the Richter scale. log₁₀(x) tells you the power of 10 that equals x.
Natural Logarithm
ln(x) = logₑ(x), where e ≈ 2.71828
The base-e logarithm, fundamental in calculus, physics, and continuous growth/decay models.
Change of Base Formula
logₐ(x) = ln(x) / ln(a) = log₁₀(x) / log₁₀(a)
Convert a logarithm from any base a to another base using this universal formula. This is how calculators compute arbitrary-base logs.
Antilogarithm
antilogₐ(y) = aʸ
The inverse of the logarithm: if logₐ(x) = y, then x = aʸ. Used to recover original values from logarithmic measurements.
Logarithm Reference Tables
Common Log Values (log₁₀)
Frequently referenced base-10 logarithm values for quick lookup.
| x | log₁₀(x) | x | log₁₀(x) |
|---|---|---|---|
| 1 | 0.0000 | 20 | 1.3010 |
| 2 | 0.3010 | 25 | 1.3979 |
| 3 | 0.4771 | 30 | 1.4771 |
| 4 | 0.6021 | 50 | 1.6990 |
| 5 | 0.6990 | 75 | 1.8751 |
| 10 | 1.0000 | 100 | 2.0000 |
| 15 | 1.1761 | 1000 | 3.0000 |
Logarithm Rules Summary
The seven fundamental logarithm properties with examples.
| Rule | Formula | Example |
|---|---|---|
| Product | log(xy) = log(x) + log(y) | log(6) = log(2) + log(3) ≈ 0.778 |
| Quotient | log(x/y) = log(x) − log(y) | log(5) = log(10) − log(2) ≈ 0.699 |
| Power | log(xⁿ) = n·log(x) | log(8) = 3·log(2) ≈ 0.903 |
| Change of base | logₐ(x) = log(x)/log(a) | log₂(8) = log(8)/log(2) = 3 |
| Identity | logₐ(a) = 1 | log₁₀(10) = 1, ln(e) = 1 |
| Zero | logₐ(1) = 0 | log of 1 is always 0 in any base |
| Inverse | a^(logₐ(x)) = x | 10^(log₁₀(100)) = 100 |
Worked Examples
Calculate log₁₀(500)
Find the common logarithm of 500.
Apply change of base: log₁₀(500) = ln(500) / ln(10)
ln(500) ≈ 6.2146, ln(10) ≈ 2.3026
log₁₀(500) = 6.2146 / 2.3026 ≈ 2.6990
log₁₀(500) ≈ 2.6990. This means 10^2.6990 = 500. Since log₁₀(100) = 2 and log₁₀(1000) = 3, 500 falls between them as expected.
Solve: If log₂(x) = 5, find x
Given log₂(x) = 5, find the value of x.
Convert from logarithmic to exponential form: log₂(x) = 5 means 2⁵ = x
Calculate: 2⁵ = 2 × 2 × 2 × 2 × 2 = 32
x = 32. This is the antilogarithm: antilog₂(5) = 2⁵ = 32.
Solve: 10^x = 2500
Find x such that 10 raised to the power x equals 2500.
Take log₁₀ of both sides: x = log₁₀(2500)
Apply change of base: log₁₀(2500) = ln(2500) / ln(10)
ln(2500) ≈ 7.8240, ln(10) ≈ 2.3026
x = 7.8240 / 2.3026 ≈ 3.3979
x ≈ 3.3979. Verify: 10^3.3979 ≈ 2500. This falls between log₁₀(1000) = 3 and log₁₀(10000) = 4.
How to Use the Log Calculator
Choose Your Calculation Mode
Select one of four tabs at the top: Logarithm (find logb(x)), Antilog (find b^y), Change of Base (convert to a new base), or Solve Variable (find the unknown when two values are known). Each tab shows only the inputs relevant to that mode.
Enter Your Number and Base
Type the number (x) in the Number field — it must be positive. For the base, click one of the preset buttons (e for natural log, 10 for common log, 2 for binary log) or type any custom positive base other than 1. The calculator updates results automatically as you type.
Adjust Precision and Review Results
Select how many decimal places to display (2, 4, 6, 8, or 10) using the Decimal Places buttons. The result appears immediately in the right panel, along with the formula used, a step-by-step solution, and the equivalent exponential form (e.g., 10^2 = 100).
Explore the Comparison Chart and Applications
In Logarithm mode, scroll down to see a bar chart comparing ln(x), log10(x), log2(x), and your custom base result side by side. Below that, real-world panels show how the result translates to decibels, the Richter scale, and bit depth. Use the Copy button to copy the formatted equation to your clipboard.
Frequently Asked Questions
What is the difference between log, ln, and log2?
All three are logarithms but use different bases. 'log' (or log10) uses base 10 and is the common logarithm used in science and engineering — it tells you how many times you must multiply 10 to reach a number. 'ln' is the natural logarithm using base e (approximately 2.71828), which appears throughout calculus, physics, and finance wherever exponential growth or decay is involved. 'log2' is the binary logarithm using base 2, essential in computer science for measuring information in bits. All three are interconvertible using the change-of-base formula: logb(x) = ln(x) / ln(b). This calculator computes all three simultaneously when you use the Logarithm tab, so you can compare them side by side.
What is an antilogarithm (antilog)?
An antilogarithm is the inverse operation of a logarithm. If logb(x) = y, then the antilog gives back x = b^y. For example, the antilog base 10 of 3 is 10^3 = 1000. Antilogs are used when you have a logarithmic measurement and want to recover the original quantity — for instance, converting a pH measurement back to hydrogen ion concentration (10^(-pH)), or converting decibels back to an intensity ratio (10^(dB/10)). The Antilog tab in this calculator takes a base b and an exponent y as inputs and returns b^y as the result, with full step-by-step explanation.
How does the change-of-base formula work?
The change-of-base formula converts a logarithm in one base to an equivalent expression using a different base: logb(x) = logk(x) / logk(b), where k can be any valid base. The most common version uses natural log: logb(x) = ln(x) / ln(b). This is important because most calculators and programming languages only have built-in functions for ln and log10, so any other base must be computed this way. For example, log5(125) = ln(125) / ln(5) = 4.828 / 1.609 = 3. The Change of Base tab in this calculator lets you enter a number, an original base, and a target new base, then shows the full conversion with steps.
Why is log(0) or log of a negative number undefined?
Logarithms are undefined for zero and negative numbers in the real number system because there is no real-valued exponent that makes b^y equal zero or a negative number. For any positive base b greater than 1, b^y is always positive for any real y — it approaches zero as y approaches negative infinity but never actually reaches zero or goes negative. This is why the domain of logb(x) is restricted to x > 0. In complex number theory, logarithms of negative numbers and zero do have definitions, but they return complex values and are beyond the scope of standard logarithm calculations. This calculator will return no result if you enter a non-positive argument.
How are logarithms used in real life?
Logarithms appear in measurements where values span many orders of magnitude. The decibel scale (sound, power, electronics) uses dB = 10 × log10(I/I₀), compressing intensities from 10^-12 W/m² to 10^2 W/m² into a 0–140 scale. The Richter scale uses log10 so each unit represents 10× more ground motion amplitude. The pH scale is pH = -log10([H+]), putting hydrogen ion concentrations from 10^-14 to 10^0 mol/L onto a 0–14 scale. In finance, the time to double an investment at continuous interest rate r is t = ln(2)/r. In computing, binary search on n items takes at most log2(n) comparisons. Radioactive half-life problems use natural logarithms. Any time a physical quantity grows or decays exponentially, logarithms describe and quantify the process.
Can I solve for the base or argument given the other two values?
Yes. The Solve Variable tab lets you find any one of the three variables in logb(x) = y given the other two. To solve for y (the logarithm result), enter base b and argument x. To solve for x (the original number), enter base b and result y — this gives x = b^y, the antilogarithm. To solve for b (the base), enter x and y, and the calculator computes b = x^(1/y), which follows algebraically from b^y = x. Note that solving for base requires y ≠ 0 (since x^(1/0) is undefined) and that the resulting base must be positive and not equal to 1 to be a valid logarithm base. The calculator validates all these conditions and shows the formula derivation in the step-by-step solution panel.
Related Tools
Logarithm Calculator
Alternative logarithm calculator with support for logarithm properties and identities.
Derivative Calculator
Compute derivatives of logarithmic and exponential functions with step-by-step solutions.
Equation Solver
Solve algebraic equations including logarithmic and exponential equations.
Online Calculator
General-purpose scientific calculator with built-in log, ln, and exponential functions.
Algebra Calculator
Solve algebra problems involving logarithmic expressions and exponential equations.