Log Calculator - Calculate Logarithms with Any Base

Free online logarithm tool

Log Calculator with Steps

Calculate a common log, natural log, binary log or logarithm with any valid base. You can also find an antilog or solve for an unknown base, then review the formula, decimal result and inverse check.

Last Updated: July 26, 2026
Base 10, e, 2 or custom
Fractions and scientific notation
Exact rational exponents
Private browser calculation

Online Logarithm Calculator

Select a calculation, enter the known values and review the logarithmic and equivalent exponential forms.

Runs in your browser
Enter a positive number, fraction, e or pi. Examples: 1000, 1/8 and 2.5e6.
A valid base is positive and not equal to 1.
Precision changes the decimal display, not the internal calculation.
Try an example

Result

log_10(1000) = 3

Exact integer exponent. The base 10 must be raised to 3 to produce 1000.

Calculation Evaluate logarithm
Decimal value 3
Formula used ln(1000) / ln(10) = 3
Inverse check 10^3 = 1000

Calculation steps

  1. Confirm that x is positive and the base is positive but not 1.
  2. Apply the change-of-base formula: ln(1000) / ln(10).
  3. The result is 3. Check it with 10^3 = 1000.

How to Use This Log Calculator

  1. Choose Evaluate logarithm when you know the argument and base and need the exponent.
  2. Choose Find argument when you know the base and exponent and need the antilog.
  3. Choose Find base when an equation gives the argument and logarithm but leaves the base unknown.
  4. Select common log, natural log, binary log or a custom base. A custom base must be positive and cannot equal 1.
  5. Enter the known values. The tool accepts integers, decimals, properly grouped numbers, scientific notation, fractions, e and pi.
  6. Select Calculate. Review the main result, decimal value, formula, equivalent exponential equation and steps.

The default example calculates log base 10 of 1000. Since 10 raised to the third power equals 1000, the answer is exactly 3. Use the precision selector when an answer is irrational or repeating. The internal calculation keeps the browser's full available precision while the selector controls only the displayed digits.

What Is a Logarithm?

A logarithm answers an exponent question. In the expression y = log base b of x, the result y tells you which power of b produces x. The equivalent exponential statement is b^y = x. These two forms contain the same information.

y = log_b(x) if and only if b^y = x

For example, log base 2 of 32 equals 5 because 2^5 equals 32. The base is 2, the argument is 32 and the logarithm is 5. This definition also explains negative and fractional answers. Log base 10 of 0.01 is -2 because 10^-2 equals 0.01. Log base 8 of 2 is 1/3 because the cube root of 8 equals 2.

The real-number logarithm requires a positive argument. Its base must also be positive and cannot be 1. Base 1 is excluded because every power of 1 remains 1, so it cannot create a one-to-one logarithmic function.

Logarithm Formula and Change of Base

Browsers provide direct natural, common and binary logarithm functions. A custom base is calculated with the change-of-base formula. The formula divides the natural log of the argument by the natural log of the selected base.

log_b(x) = ln(x) / ln(b), where x is positive, b is positive and b is not 1

Changing both logarithms to base 10 produces the same result: log_b(x) = log(x) / log(b). The chosen numerator and denominator base does not change the answer as long as both use the same valid base.

Worked example: log base 5 of 125

Calculate log base 5 of 125. Apply the change-of-base formula, then verify the answer by reversing the operation.

log_5(125) = ln(125) / ln(5) = 3
Check: 5^3 = 125

The answer is exact because 125 is an integer power of 5. For a value such as log base 2 of 10, the result is approximately 3.32192809489. It is not a whole-number power, so a rounded decimal is appropriate.

Common Log vs Natural Log vs Binary Log

Common logarithm bases and typical uses
Log type Base Notation Example Typical use
Common log 10 log(x) or log_10(x) log(1000) = 3 Orders of magnitude, pH, decibels and decimal scales
Natural log e ln(x) ln(e) = 1 Continuous growth, calculus, finance and probability
Binary log 2 log_2(x) log_2(1024) = 10 Computer science, information and algorithm analysis
Custom-base log Any valid b log_b(x) log_8(2) = 1/3 Algebra, base conversion and specialized models

In many textbooks, log without a written base means base 10, while ln always means base e. Some computer science contexts use log for base 2. Check the notation used by your course, software or formula before selecting a base.

Understanding Positive, Zero and Negative Log Results

When the base is greater than 1, an argument greater than 1 produces a positive logarithm. An argument equal to 1 produces 0. An argument between 0 and 1 produces a negative logarithm. These signs follow directly from exponent rules.

  • log base 10 of 100 equals 2 because 10^2 equals 100.
  • log base 10 of 1 equals 0 because 10^0 equals 1.
  • log base 10 of 0.001 equals -3 because 10^-3 equals 0.001.

A fractional base between 0 and 1 reverses the direction. For base 0.5, larger positive arguments require negative exponents. Log base 0.5 of 8 equals -3 because 0.5^-3 equals 8. Fractional bases are valid, even though they are less common in introductory examples.

A negative logarithm does not mean the argument is negative. Real logarithms reject zero and negative arguments. A negative result means the positive argument corresponds to a negative exponent for the selected base.

Logarithm Laws

Logarithm properties turn multiplication into addition, division into subtraction and powers into multiplication. These rules apply only when every logarithm has a valid positive argument and the same valid base.

Core logarithm properties
Rule Formula Example in base 10
Product rule log_b(MN) = log_b(M) + log_b(N) log(100 x 10) = 2 + 1 = 3
Quotient rule log_b(M/N) = log_b(M) - log_b(N) log(100/10) = 2 - 1 = 1
Power rule log_b(M^p) = p log_b(M) log(10^4) = 4 log(10) = 4
Identity log_b(b) = 1 log(10) = 1
Argument one log_b(1) = 0 log(1) = 0

Do not split a logarithm across addition or subtraction inside its argument. In general, log(M + N) is not equal to log(M) + log(N). The product, quotient and power structures must match the stated rules.

Antilog and Unknown-Base Calculations

An antilog reverses a logarithm. If y = log base b of x, then x = b^y. Select Find argument, enter b and y, and the calculator raises the base to the exponent. For example, the base-10 antilog of 3 is 1000.

Antilog: x = b^y

The unknown-base mode rearranges the same relationship. When x and y are known and y is not zero, b = x^(1/y). For log base b of 1000 equals 3, the base is 1000^(1/3), which equals 10.

Unknown base: b = x^(1/y)

Special cases need interpretation. If x equals 1 and y equals 0, infinitely many bases work because log base b of 1 equals 0 for every positive base except 1. If x is not 1 and y equals 0, no valid base works. If x equals 1 but y is not 0, the equation also has no valid base.

Inputs, Domain Rules and Error Messages

The calculator accepts signed integers, decimals, scientific notation, properly grouped numbers and one fraction bar. You may also type e or pi. Examples include 125, 0.001, 1,000, 2.5e-8 and 3/4. It rejects arithmetic expressions, malformed grouping, hexadecimal values, a zero fraction denominator and values outside the browser's finite number range.

Real logarithm domain checks
Input Requirement Reason
Argument x x must be positive No real exponent of a positive base produces zero or a negative result.
Base b b must be positive A real logarithmic base cannot be zero or negative.
Base b b cannot equal 1 Powers of 1 do not create a one-to-one function.
Exponent y y must be finite Antilog and unknown-base calculations require a representable real exponent.

Entries that would overflow to Infinity or underflow to zero receive a controlled message. The calculator never presents NaN or Infinity as a usable answer. Correct the indicated field and calculate again.

Accuracy, Exact Results and Rounding

The tool calculates with JavaScript Number arithmetic, which follows the IEEE 754 double-precision format. It provides about 15 to 17 significant decimal digits for typical values. Many decimal numbers do not have an exact binary representation, so the last displayed digit can reflect floating-point rounding.

For rational inputs, the calculator checks simple rational exponents with exact integer arithmetic. This allows results such as log base 8 of 2 equals 1/3 and log base 2 of 1/8 equals -3 to remain exact. If that exact check fails, the page labels the answer as a decimal approximation instead of guessing an exact form.

Values close to 1 need care because subtractive rounding can affect an ordinary logarithm calculation. The calculator uses a stable natural-log method near 1. Even so, a base so close to 1 that it rounds to 1 cannot be distinguished by browser number arithmetic and is rejected.

  • Keep extra digits until the final step.
  • Match the base used by the original formula.
  • Do not round the numerator and denominator of the change-of-base formula separately.
  • Verify important work with the equivalent exponential equation.

Where Logarithms Are Used

Logarithms compress wide ranges and reverse exponential relationships. Common logs help describe powers of ten. Natural logs appear in continuous growth and decay, compound growth, calculus and probability. Binary logs measure repeated doubling and support computer science analysis.

  • Science: pH, sound intensity, earthquake magnitude and exponential decay.
  • Finance: solving for time or rate in compound-growth models.
  • Technology: bits, binary search depth, information content and algorithm complexity.
  • Statistics: likelihood calculations and transformations of skewed data.
  • Engineering: gain, attenuation and systems measured across large ranges.

A calculator supplies the numerical operation, but the model still determines the correct base, units and interpretation. Review the source formula before applying the result to a real system.

Method and Review Basis

The definition, logarithm properties and change-of-base steps follow the treatment in OpenStax College Algebra 2e. The inverse relationship between exponential and logarithmic equations follows OpenStax exponential and logarithmic equations.

The browser calculation uses the standard JavaScript logarithm functions and a stable log1p calculation near 1, as documented by MDN Math.log and MDN Math.log1p. Exact rational labels require an integer identity check. Other results remain identified as decimal approximations.

Related Calculators

Use a focused tool when your problem includes a full expression, polynomial equation, radical or broader arithmetic.

Browse the complete Math & Statistics Calculators directory for more algebra, percentage, geometry and statistics tools.

Frequently Asked Questions

What is a logarithm?

A logarithm is the exponent needed to raise a base to a given positive number. If log base b of x equals y, then b raised to y equals x.

What is the difference between log and ln?

Log usually means base 10 in general mathematics, while ln means the natural logarithm with base e. Some computer science contexts use log for base 2, so check the stated convention.

Can this calculator use any logarithm base?

Yes. Select base 10, e, 2 or enter a custom base. The base must be greater than 0 and cannot equal 1.

Why must a logarithm argument be positive?

For a positive real base, no real exponent produces zero or a negative number. Therefore a real logarithm is defined only when its argument is greater than 0.

Is a logarithm base between 0 and 1 valid?

Yes. A base such as 0.5 is valid because it is positive and not 1. Its logarithmic function decreases, so its result signs differ from a base greater than 1.

Why is my logarithm result negative?

A negative result means the selected base needs a negative exponent to produce the positive argument. For example, log base 10 of 0.01 equals -2 because 10 raised to -2 equals 0.01.

What is the change-of-base formula?

The formula is log base b of x equals ln(x) divided by ln(b). It converts a logarithm with any valid base into natural logarithms supported by a calculator.

Can I enter fractions and scientific notation?

Yes. Examples include 1/8, 3/4, 1e6 and 2.5e-8. A fraction denominator cannot be zero, and the complete value must remain finite.

Are logarithm calculator results exact?

Some results are exact integers or verified rational exponents. Other logarithms are irrational and appear as rounded decimal approximations at the selected display precision.

Are my calculator entries stored or sent to a server?

No. The calculation runs in your browser and the page does not submit the entered values to a calculation server or save a calculation history.

Educational and financial disclaimer: This calculator provides general mathematical results from the values you enter. It is not financial, scientific, engineering, tax or professional advice. Verify the formula, base, units, source data and required precision before using a result for an important decision.

Post a Comment

0Comments

Post a Comment (0)