Home › Calculators › Logarithm Calculator

Logarithm Calculator

Work out log_b(x) for any base, the natural log ln(x), log₁₀ and log₂ at once, or switch to antilog mode to calculate bʸ. Every answer comes with the change-of-base working and a check.

Last updated:

log₂(x)–
ln x (base e)–
log₁₀ x–
log₂ x–

Change-of-base steps

    Examples

    Advertisement

    How to use the Logarithm Calculator

    1. Enter the number x you want the logarithm of. It must be positive. You can type decimals, fractions like 1/8, 2.5e-4 or e.
    2. Choose the base: e for ln, 10 for the common log, 2 for the binary log, or Custom to type any base b.
    3. Press Calculate (results also update as you type) to see log_b(x) along with ln, log₁₀ and log₂ of the same number.
    4. Read the steps to see the change-of-base formula ln(x) / ln(b) worked out.
    5. Switch to Antilog to go the other way: enter a base and a value y to get bʸ.

    Logarithm rules

    RuleFormulaExample
    Definitionlog_b(x) = y ⇔ bʸ = xlog₂ 32 = 5 because 2⁵ = 32
    Productlog_b(xy) = log_b x + log_b ylog 200 = log 2 + log 100 ≈ 0.30103 + 2
    Quotientlog_b(x/y) = log_b x − log_b yln(e³/e) = 3 − 1 = 2
    Powerlog_b(xⁿ) = n · log_b xlog₂ 8⁴ = 4 × 3 = 12
    Change of baselog_b x = ln x / ln blog₅ 100 = 4.60517 / 1.60944 ≈ 2.86135
    Log of 1log_b 1 = 0ln 1 = 0
    Log of the baselog_b b = 1log₁₀ 10 = 1
    Reciprocal baselog_b x = 1 / log_x blog₈ 2 = 1/3

    Worked example: log base 3 of 20

    1. Ask: 3 to what power gives 20? Since 3² = 9 and 3³ = 27, the answer is between 2 and 3.
    2. Change of base: log₃ 20 = ln 20 / ln 3.
    3. ln 20 ≈ 2.9957323 and ln 3 ≈ 1.0986123.
    4. 2.9957323 / 1.0986123 ≈ 2.7268330.
    5. Check: 3^2.7268330 ≈ 20.000000.

    Common logarithm values

    xlog₁₀ xln xlog₂ x
    0.5−0.30103−0.69315−1
    1000
    20.301030.693151
    e ≈ 2.718280.4342911.44270
    30.477121.098611.58496
    50.698971.609442.32193
    1012.302593.32193
    10024.605176.64386
    100036.907769.96578

    Frequently asked questions

    What is a logarithm?

    A logarithm is the power you must raise the base to in order to get the number. log₂ 8 = 3 because 2³ = 8, and log₁₀ 1000 = 3 because 10³ = 1000.

    How do I calculate a log with a different base?

    Use the change-of-base formula: log_b(x) = ln(x) / ln(b) = log₁₀(x) / log₁₀(b). For example log₃ 20 = ln 20 / ln 3 = 2.995732 / 1.098612 ≈ 2.726833.

    What is the difference between log and ln?

    ln is the natural logarithm with base e ≈ 2.71828. log usually means base 10 in science and on calculators, but in computer science it often means base 2. This calculator shows all three for the same number.

    Why can't I take the log of 0 or a negative number?

    A positive base raised to any real power is always positive, so no real exponent gives 0 or a negative number. log(0) tends to minus infinity and logs of negative numbers are only defined with complex numbers.

    What is an antilog?

    The antilog is the inverse of a logarithm: antilog_b(y) = bʸ. For base 10, antilog(2.5) = 10^2.5 ≈ 316.2278. For the natural log, the antilog is eʸ.

    Why can't the base be 1?

    1 raised to any power is 1, so log base 1 could never give any other number. The base must be positive and different from 1.

    What is log base 2 used for?

    log₂ tells you how many times you can halve a number or how many bits are needed. log₂ 1024 = 10, so 10 bits can store 1024 different values.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    Scientific CalculatorTrig, logs, powers and more in your browser.Graphing CalculatorPlot multiple functions with zoom, pan, intersections and a value table.Fraction CalculatorAdd, subtract, multiply and divide fractions with steps.Standard Deviation CalculatorStandard deviation, variance, mean, median, mode and quartiles.Buffer pH CalculatorBuffer pH from pKa and acid/base concentrations, or the recipe for a target pH.Cubic Equation SolverSolve ax³ + bx² + cx + d = 0 for real and complex roots with steps and a graph.Decibel CalculatorAdd dB levels, convert power or voltage ratios to dB, and find sound level at a distance.Effective Annual Rate CalculatorConvert a nominal rate to the effective annual rate (EAR / APY) for any compounding, or back.Exponent CalculatorRaise any number to a power, including negative and fractional exponents.Quadratic Equation SolverSolve ax² + bx + c = 0 with exact roots, steps, vertex and a parabola graph.Matrix CalculatorAdd, multiply, invert and row-reduce matrices up to 5×5 with exact fractions and steps.Prime Number CheckerCheck if a number is prime, factor it with a factor tree and list primes in a range.GCF and LCM CalculatorFind the GCF and LCM of two or more numbers with Euclid steps and prime factorization.Cubic Yard CalculatorConvert length, width and depth in any unit to cubic yards, cubic feet, m³ and material weight.Factorial CalculatorExact n! up to 5000! with digit count, trailing zeros and double factorial.Prime Factorization CalculatorFind prime factors in exponent form with a factor tree, divisor count and divisors list.Modulo CalculatorCalculate a mod n and the quotient, with floored, truncated and Euclidean rules.Exponential Growth CalculatorExponential growth and decay: final amount, rate or time, discrete or continuous.Linear Regression CalculatorLeast-squares line of best fit: slope, intercept, r, r², predictions and a scatter plot.System of Equations SolverSolve 2×2, 3×3 and 4×4 linear systems with exact fractions and step-by-step working.Summation CalculatorEvaluate sigma notation: sum any expression in n from a to b with partial sums and a chart.Arithmetic Sequence CalculatorFind the n-th term, sum and full list of an arithmetic sequence, or d from two terms.Fibonacci CalculatorExact n-th Fibonacci number (BigInt), sequence lists, Fibonacci check and golden ratio.Factors CalculatorAll factors and factor pairs of a number, prime factors, divisor count and perfect check.Depth of Field CalculatorNear and far focus limits, depth of field and hyperfocal distance for any camera or lens.Crop Factor CalculatorCrop factor, full-frame equivalent focal length and aperture, and field of view for any sensor.Completing the Square CalculatorRewrite ax² + bx + c in vertex form a(x − h)² + k step by step and solve it.Derivative CalculatorSymbolic derivative of any f(x) up to 5th order, with steps, slope at a point and a graph.Factoring Trinomials CalculatorFactor trinomials and polynomials: GCF, ac method, difference of squares, cubes, with steps.Integral CalculatorDefinite integral of f(x) from a to b with adaptive Simpson, area graph and antiderivative.Least Common Denominator CalculatorFind the LCD of two or more fractions and rewrite them as equivalent fractions, with steps.Limiting Reactant CalculatorFind the limiting reactant, theoretical yield and leftover excess from an equation.Parabola CalculatorVertex, focus, directrix, axis, intercepts and graph of a parabola from its equation.Polynomial Root FinderFind all real and complex roots of a polynomial up to degree 10, with the factored form.Prime Number List GeneratorList all primes in a range or the first N primes with a fast sieve; copy or download the list.Quadratic Regression CalculatorFit y = ax² + bx + c (or up to degree 6) to x, y data with R², predictions and a graph.Scatter Plot MakerPaste X,Y pairs for a scatter plot with trendline, equation, r and R². Download PNG.Synthetic Division CalculatorDivide polynomials by x − c (synthetic table) or any polynomial (long division) with steps.Perpendicular Line CalculatorEquation of the perpendicular and parallel line through a point, with distance and a graph.Polar Graphing CalculatorGraph polar equations r = f(θ): roses, cardioids, spirals, with a θ range slider and PNG export.Polynomial CalculatorAdd, subtract, multiply, divide and evaluate polynomials; see roots, degree and a graph.Polynomial Long Division CalculatorDivide polynomials with the full long division layout, quotient, remainder and steps.Scale Factor CalculatorScale factor between similar figures, plus scaled lengths, areas (k²) and volumes (k³).Set CalculatorUnion, intersection, difference and complement of up to 4 sets, with a Venn diagram and counts.Table of Values CalculatorMake an x/y table for any function with a start, end and step, then plot it or copy CSV.3D Graphing CalculatorPlot z = f(x, y) surfaces and 3D parametric curves; rotate, zoom, add contours, save PNG.Algebra CalculatorSimplify, expand and factor algebraic expressions with exact answers and step-by-step working.Determinant CalculatorDeterminant of a 2×2 to 8×8 matrix with exact fractions and cofactor or row-reduction steps.Differential Equation SolverSolve first- and second-order ODEs step by step, with initial conditions, an RK4 check and a graph.Domain and Range CalculatorFind the domain and range of a function in interval notation, with steps and a graph.Eigenvalue and Eigenvector CalculatorEigenvalues (real or complex), eigenvectors and the characteristic polynomial of a square matrix.Inequality CalculatorSolve linear, quadratic, rational and absolute value inequalities with steps and a number line.Inverse Function CalculatorFind the inverse f⁻¹(x) of a function with steps, domain restrictions and a graph.Laplace Transform CalculatorLaplace transform of f(t) with the table rule used for each term and the region of convergence.Limit CalculatorEvaluate limits at a point or at infinity, one-sided or two-sided, with steps, table and graph.Linear Interpolation CalculatorInterpolate or extrapolate y for any x from two points or a data table, with steps and a plot.Matrix Inverse CalculatorFind the inverse of a 2×2 to 8×8 matrix in exact fractions with Gauss–Jordan or adjugate steps.Partial Derivative CalculatorPartial derivatives ∂/∂x, ∂/∂y, second and mixed orders with steps, gradient and Hessian.RREF CalculatorRow reduce any matrix to RREF with exact fractions, every row operation, pivots and rank.Stem and Leaf Plot MakerMake stem-and-leaf plots (standard, split stems or back-to-back) with a key; copy or save PNG.Taylor Series CalculatorTaylor and Maclaurin polynomials of any f(x) to order n, with exact coefficients and a graph.Antilog CalculatorInverse logarithm (antilog) in base 10, e, 2 or any base, with steps and scientific notation.Asymptote CalculatorFind vertical, horizontal and slant asymptotes and holes of a function, with graph and reasoning.Cramer's Rule CalculatorSolve 2x2 and 3x3 linear systems by Cramer's rule with every determinant shown step by step.Dot Plot MakerMake a dot plot or line plot from data or a frequency table; download PNG or SVG.Extended Euclidean Algorithm CalculatorFind gcd(a, b) and Bézout coefficients x, y with the full step-by-step division table.Factor Tree GeneratorDraw the prime factor tree of any number as a printable diagram, with exponent form and steps.Function Composition CalculatorFind f(g(x)), g(f(x)), f + g, f · g and f / g with values at a point and domains.
    See all 74 Algebra & Calculus Calculators →