Logarithm Calculator: Log, ln, log10 & Change of Base

Calculate logarithms with any base, natural logs, common logs, and change-of-base steps. Includes formulas, examples, rules, FAQs, and a full guide.
Logarithm Calculator
Free online math tool

Logarithm Calculator: Log, Natural Log, Common Log & Change of Base

Use this logarithm calculator to calculate \(\log_b(x)\), natural logarithms \(\ln(x)\), common logarithms \(\log_{10}(x)\), binary logarithms \(\log_2(x)\), and change-of-base results. The calculator also explains the formula used, so you can understand the method instead of only copying the answer.

A logarithm answers a very specific question: what exponent must a base be raised to in order to get a given number? For example, \(\log_2(8)=3\) because \(2^3=8\). This relationship between logarithms and exponents is the main idea behind every logarithm calculation.

Any base log Natural log ln Common log log10 Binary log Change of base Exponential form

For real-number logarithms, the input value must be positive, the base must be positive, and the base cannot equal 1.

Logarithm Calculator

Result
3
log base 2 of 8 is 3.
Formula: log₂(8) = ln(8) / ln(2) = 3

What Is a Logarithm?

A logarithm is the inverse operation of exponentiation. Exponentiation starts with a base and an exponent, then produces a value. A logarithm starts with a base and a value, then asks for the exponent. In simple words, a logarithm tells you the power needed to produce a number.

\[ \log_b(x)=y \quad \Longleftrightarrow \quad b^y=x \]

In this formula, \(b\) is the base, \(x\) is the value or argument, and \(y\) is the logarithm. The statement \(\log_b(x)=y\) means that the base \(b\) must be raised to the power \(y\) to produce \(x\).

For example, \(\log_2(8)=3\) because \(2^3=8\). Similarly, \(\log_{10}(1000)=3\) because \(10^3=1000\). A logarithm is not a new kind of number; it is a way to describe an exponent.

Logarithms are used in algebra, calculus, science, finance, computer science, data analysis, chemistry, biology, engineering, machine learning, and many other subjects. They are especially helpful when numbers grow or shrink very quickly. Exponential growth can become difficult to interpret directly, but logarithms compress large values into a more manageable scale.

Logarithm Formula and Variable Meanings

The core logarithm formula connects logarithmic form and exponential form. This is the most important formula to understand before using any logarithm calculator.

\[ \log_b(x)=y \]

Where:

  • \(b\) = base of the logarithm
  • \(x\) = argument or value inside the logarithm
  • \(y\) = exponent or logarithm result

The equivalent exponential form is:

\[ b^y=x \]

This equivalence is important because many logarithm problems become easier when rewritten as exponential equations. If you see \(\log_3(81)\), you can ask, “3 raised to what power equals 81?” Since \(3^4=81\), the answer is \(4\).

Important domain rule: For real-number logarithms, \(x>0\), \(b>0\), and \(b\ne1\). You cannot take the real logarithm of zero or a negative number, and the base cannot be 1.

How to Use the Logarithm Calculator

The calculator above supports the most common logarithm tasks. You can calculate a logarithm with any valid base, evaluate the natural logarithm, evaluate the common logarithm, calculate binary logarithms, use the change-of-base formula, or convert logarithmic form into exponential form.

  1. Choose the calculation type. Select whether you want any-base logarithm, natural log, common log, binary log, change of base, or exponential form.
  2. Enter the required values. For \(\log_b(x)\), enter the base \(b\) and value \(x\).
  3. Check the domain. The value \(x\) must be positive. The base \(b\) must be positive and cannot equal \(1\).
  4. Calculate the result. The calculator uses the correct logarithm formula and displays the result.
  5. Read the formula line. The formula line shows how the answer was calculated, which helps with homework, revision, and checking steps.
  6. Round appropriately. You can change the number of decimal places depending on the precision you need.

Types of Logarithms

There are many possible logarithm bases, but three types appear most often: common logarithms, natural logarithms, and binary logarithms. They all follow the same basic rule, but each is useful in different contexts.

Common Logarithm

The common logarithm has base 10 and is written as \(\log_{10}(x)\). In many school textbooks and calculators, the notation \(\log(x)\) often means base 10, although notation can vary by subject.

\[ \log_{10}(1000)=3 \]

This is true because \(10^3=1000\). Common logarithms are useful when working with powers of 10, scientific notation, pH, decibels, and measurement scales that compress very large ranges.

Natural Logarithm

The natural logarithm has base \(e\), where \(e\approx2.71828\). It is written as \(\ln(x)\).

\[ \ln(x)=\log_e(x) \]

Natural logarithms are especially important in calculus, exponential growth, compound interest, population models, radioactive decay, continuous change, and advanced science. The base \(e\) appears naturally whenever change depends continuously on the current value.

Binary Logarithm

The binary logarithm has base 2 and is written as \(\log_2(x)\). It is common in computer science because computers store and process information using binary systems.

\[ \log_2(32)=5 \]

This is true because \(2^5=32\). Binary logarithms appear in algorithm analysis, data storage, information theory, binary trees, search complexity, and computing performance.

Change of Base Formula

The change-of-base formula allows you to calculate a logarithm in any base using a logarithm in another base. This is useful because many calculators have dedicated buttons for \(\ln(x)\) and \(\log_{10}(x)\), but not for every possible base.

\[ \log_b(x)=\frac{\log_k(x)}{\log_k(b)} \]

In this formula, \(k\) can be any valid logarithm base. Two common versions are:

\[ \log_b(x)=\frac{\ln(x)}{\ln(b)} \]
\[ \log_b(x)=\frac{\log_{10}(x)}{\log_{10}(b)} \]

For example, to calculate \(\log_5(125)\), you can use natural logs:

\[ \log_5(125)=\frac{\ln(125)}{\ln(5)}=3 \]

The answer is \(3\) because \(5^3=125\). The calculator uses this same idea for any-base logarithms.

Logarithm Rules

Logarithm rules help simplify expressions, solve equations, and transform multiplication or division into addition or subtraction. These rules work when the logarithms have the same valid base and all arguments are positive.

Rule Formula Meaning Example
Product Rule \(\log_b(MN)=\log_b(M)+\log_b(N)\) The log of a product becomes the sum of logs. \(\log_2(8\cdot4)=\log_2(8)+\log_2(4)\)
Quotient Rule \(\log_b\left(\frac{M}{N}\right)=\log_b(M)-\log_b(N)\) The log of a quotient becomes the difference of logs. \(\log_{10}\left(\frac{1000}{10}\right)=3-1\)
Power Rule \(\log_b(M^r)=r\log_b(M)\) An exponent inside the log can move to the front. \(\log_2(8^2)=2\log_2(8)\)
Base Identity \(\log_b(b)=1\) A base raised to the first power equals itself. \(\log_7(7)=1\)
Log of 1 \(\log_b(1)=0\) Any valid base raised to the zero power equals 1. \(\log_5(1)=0\)
Inverse Rule \(b^{\log_b(x)}=x\) Exponentials and logarithms undo each other. \(10^{\log_{10}(25)}=25\)

Worked Logarithm Examples

Worked examples make logarithms much easier to understand because they show the connection between logarithmic form and exponential form. When you are unsure how to evaluate a logarithm, rewrite it as an exponential equation.

Example 1: Calculate \(\log_2(8)\)

We want to find the exponent that makes base \(2\) equal to \(8\).

\[ \log_2(8)=y \]

Rewrite in exponential form:

\[ 2^y=8 \]

Since \(2^3=8\), the answer is:

\[ \log_2(8)=3 \]

Example 2: Calculate \(\log_{10}(1000)\)

This is a common logarithm because the base is \(10\). We need the exponent that turns \(10\) into \(1000\).

\[ 10^3=1000 \]

Therefore:

\[ \log_{10}(1000)=3 \]

This pattern is why powers of 10 are easy with common logarithms. \(\log_{10}(10)=1\), \(\log_{10}(100)=2\), \(\log_{10}(1000)=3\), and so on.

Example 3: Calculate \(\ln(20)\)

The natural logarithm has base \(e\). This means:

\[ \ln(20)=\log_e(20) \]

The exact result is not usually a simple whole number. A calculator gives:

\[ \ln(20)\approx2.995732 \]

This means that \(e^{2.995732}\approx20\). Natural logs are common in continuous growth and decay problems because the base \(e\) is connected to continuous rates of change.

Example 4: Use change of base for \(\log_5(125)\)

Use the change-of-base formula:

\[ \log_5(125)=\frac{\ln(125)}{\ln(5)} \]

Since \(5^3=125\), the exact answer is:

\[ \log_5(125)=3 \]

Logarithm Domain Restrictions

Logarithms have restrictions in the real-number system. These restrictions are not optional; they come from the definition of a logarithm as the inverse of an exponential function.

The argument must be positive

\[ x>0 \]

In real-number logarithms, you cannot calculate \(\log_b(0)\) or \(\log_b(-5)\).

The base must be positive

\[ b>0 \]

A negative base creates problems in the real logarithm system because exponent behavior becomes inconsistent for many values.

The base cannot equal 1

\[ b\ne1 \]

Since \(1^y=1\) for every \(y\), base 1 cannot produce different positive values.

These restrictions are why the calculator checks your input before giving a result. If the base is invalid or the argument is not positive, the calculator will ask you to correct the input instead of showing a misleading answer.

Why Logarithms Are Useful

Logarithms are useful because they transform difficult scale problems into easier comparison problems. When numbers grow exponentially, their values can become extremely large. Logarithms compress those values into a smaller and more readable range. This is why logarithmic scales are used for sound intensity, earthquake magnitude, acidity, information measurement, and scientific data.

In algebra, logarithms help solve equations where the unknown variable is in an exponent. For example, if \(2^x=20\), the answer is not an obvious whole number. Taking a logarithm allows you to solve for \(x\):

\[ x=\log_2(20)=\frac{\ln(20)}{\ln(2)} \]

In calculus, natural logarithms are essential because the derivative and integral relationships involving \(e^x\) and \(\ln(x)\) are central to continuous change. In science, logarithms appear in models for growth, decay, concentration, intensity, and rate processes. In computer science, logarithms help describe how efficiently algorithms run as input size increases.

Common Mistakes with Logarithms

Logarithms become much easier when you remember that they are exponents. Many errors happen when students treat logarithms like ordinary multiplication or forget the domain rules.

Mistake 1: Thinking \(\log_b(M+N)=\log_b(M)+\log_b(N)\)

This is not a valid rule. The product rule applies to multiplication inside the log, not addition.

\[ \log_b(MN)=\log_b(M)+\log_b(N) \]

Mistake 2: Forgetting that the argument must be positive

In real-number logarithms, expressions inside a logarithm must be greater than zero. For example, \(\ln(x-4)\) requires \(x-4>0\), so \(x>4\).

Mistake 3: Confusing base and argument

In \(\log_b(x)\), the small lower number is the base, and the value inside parentheses is the argument. Swapping them changes the meaning completely.

Mistake 4: Assuming every log means base 10

In many school calculators, \(\log(x)\) means \(\log_{10}(x)\). In some advanced contexts, notation can vary. Natural log is always written as \(\ln(x)\).

Logarithm Calculator Reference Table

This table summarizes common logarithm values that are useful for mental math and checking calculator results.

Expression Value Why?
\(\log_2(2)\) \(1\) \(2^1=2\)
\(\log_2(8)\) \(3\) \(2^3=8\)
\(\log_2(32)\) \(5\) \(2^5=32\)
\(\log_{10}(10)\) \(1\) \(10^1=10\)
\(\log_{10}(1000)\) \(3\) \(10^3=1000\)
\(\ln(e)\) \(1\) \(e^1=e\)
\(\ln(1)\) \(0\) \(e^0=1\)
\(\log_b(1)\) \(0\) \(b^0=1\) for any valid base \(b\)

FAQ: Logarithm Calculator

What does a logarithm calculator do?

A logarithm calculator finds the exponent needed for a base to produce a given value. For example, it calculates \(\log_2(8)=3\) because \(2^3=8\).

What is the formula for a logarithm?

The main formula is \(\log_b(x)=y\), which is equivalent to \(b^y=x\). The base is \(b\), the argument is \(x\), and the result is \(y\).

What is the difference between log and ln?

\(\ln(x)\) means natural logarithm with base \(e\). In many school calculators, \(\log(x)\) means common logarithm with base \(10\). So \(\ln(x)=\log_e(x)\), while \(\log(x)\) often means \(\log_{10}(x)\).

Can the base of a logarithm be 1?

No. The base of a real logarithm cannot be 1 because \(1^y=1\) for every exponent \(y\). A base of 1 cannot produce different positive values, so it does not define a useful logarithm.

Can I calculate the logarithm of a negative number?

Not as a real number. In the real-number system, the argument of a logarithm must be positive. Negative logarithm inputs require complex-number methods, which are outside the scope of this basic calculator.

What is the change-of-base formula?

The change-of-base formula is \(\log_b(x)=\frac{\ln(x)}{\ln(b)}\) or \(\log_b(x)=\frac{\log_{10}(x)}{\log_{10}(b)}\). It lets you calculate a logarithm in any base using natural logs or common logs.

Why is \(\log_b(1)=0\)?

Because any valid base raised to the zero power equals 1. Since \(b^0=1\), it follows that \(\log_b(1)=0\).

Why is \(\log_b(b)=1\)?

Because a base raised to the first power equals itself. Since \(b^1=b\), the logarithm \(\log_b(b)\) equals \(1\).

Related Calculators and Guides

Continue with related tools if your logarithm calculation is part of a larger algebra, science, finance, or exam-prep task.

More Sly academy Content

Calculate Your AP Score
Support Us