Log Calculator
Must be a positive number greater than 0
Positive number, not equal to 1. Type 'e' for natural log.
Enter Values to Calculate
Select a tab, enter the number and base, then see the logarithm result with step-by-step solution, comparison chart, and real-world examples.
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.