NOTACAL logo

Log Calculator

Log Calculator

Enter a positive number
Give us your feedback! Was this useful?

Introduction

A logarithm (log) is a mathematical operation that represents the exponent to which a base number must be raised to produce a given value. Think of logarithms as the inverse operation of exponentiation — while exponents ask "what power gives us this result?", logarithms ask "what exponent produces this number?"

For example, since 102 = 100, we can say that log10(100) = 2. The logarithm tells us that 10 raised to the power of 2 equals 100. This inverse relationship between logarithms and exponents is fundamental to understanding how they work and why they are so useful in mathematics and science.

Logarithms have been essential tools since the 17th century, when John Napier first introduced them to simplify complex calculations in astronomy and navigation. Before electronic computers, logarithm tables allowed scientists and engineers to perform multiplication and division by converting these operations into simpler addition and subtraction problems. Today, logarithms remain crucial in fields ranging from computer science and data science to chemistry, physics, and finance.

Logarithms are particularly valuable because they convert multiplicative relationships into additive ones. This property makes it possible to work with quantities spanning many orders of magnitude — from subatomic particles to galactic distances — using a compact, intuitive scale. Whenever you see a pH reading, a decibel level, or an earthquake magnitude, you are experiencing a logarithmic transformation that makes extreme values human-readable.

How to Use

Using the Log Calculator is straightforward. Follow these steps to compute logarithms accurately:

  1. Enter the argument (x). The argument is the number for which you want to calculate the logarithm. This must be a positive number greater than zero, as logarithms are only defined for positive values. Enter a value like 100, 2.5, or 0.01 in the argument field.
  2. Select or enter the base (b). Choose your preferred base from the dropdown menu. Options include: Common Logarithm (base 10) — used in scientific calculations and engineering; Natural Logarithm (base e ≈ 2.718) — used in advanced mathematics and physics; Binary Logarithm (base 2) — used in computer science and information theory; Custom Base — enter any positive number (except 1) as your base.
  3. Click "Calculate". The calculator will compute the logarithm and display the result, along with a step-by-step explanation showing how the answer was derived.
  4. Review the results. The output shows the numerical result, the exponential form (how the base raised to the result equals the argument), and relevant logarithm rules applied.

Practical Example

Suppose you want to calculate log2(32): Enter 32 as the argument, select "Custom Base" and enter 2, click Calculate. The result is 5 (since 25 = 32). This means 2 raised to the power of 5 equals 32, confirming that log2(32) = 5.

As another example, consider log10(0.001): Enter 0.001 as the argument, select base 10, click Calculate. The result is -3, because 10-3 = 0.001. This demonstrates that arguments between 0 and 1 produce negative logarithms. For a natural log example, calculate ln(20) ≈ 2.996, meaning e2.996 ≈ 20. These examples show how the calculator handles different bases and argument ranges.

Formulas and Calculations

The formal definition of a logarithm states that for any base b greater than 0 (where b is not equal to 1) and any positive number x:

y=logb(x)    by=xy = \log_b(x) \iff b^y = x
[wolfram-log]
[wolfram-log]

Where: b equals the base of the logarithm (the number being raised to a power), x equals the argument (the value we want to find the logarithm of), y equals the result (the exponent). The logarithm y tells us what exponent we need to raise b to get x.

Product Rule

When multiplying two numbers with the same base inside a logarithm, you can separate them into the sum of two logarithms. This rule is particularly useful because it turns multiplication into addition, which is easier to compute manually. For example, log10(100 × 10) = log10(100) + log10(10) = 2 + 1 = 3.

logb(x×y)=logb(x)+logb(y)\log_b(x \times y) = \log_b(x) + \log_b(y)

Quotient Rule

When dividing two numbers inside a logarithm, you can express this as the difference of two logarithms. This converts division into subtraction. For instance, log2(32/4) = log2(32) - log2(4) = 5 - 2 = 3.

logb(xy)=logb(x)logb(y)\log_b\left(\frac{x}{y}\right) = \log_b(x) - \log_b(y)

Power Rule

When the argument of a logarithm is raised to a power, you can bring that exponent to the front as a multiplier. This is especially useful when dealing with roots, since taking a root is equivalent to raising to a fractional power. For example, log3(92) = 2 × log3(9) = 2 × 2 = 4.

logb(xy)=y×logb(x)\log_b(x^y) = y \times \log_b(x)

Change of Base Formula

Sometimes you need to calculate a logarithm in a base for which you do not have direct capabilities. The change of base formula lets you convert between bases. This formula works with any base k (commonly 10 or e). For example, to calculate log2(8) using natural logarithms: log2(8) = ln(8)/ln(2) ≈ 2.079/0.693 ≈ 3.

logb(x)=logk(x)logk(b)\log_b(x) = \frac{\log_k(x)}{\log_k(b)}

Natural Logarithm Special Cases

The natural logarithm uses the mathematical constant e ≈ 2.718281828 as its base. It has special properties: ln(ex) = x, ln(1) = 0, and ln(e) = 1. The natural logarithm appears frequently in calculus, exponential growth and decay models, and compound interest calculations.

ln(ex)=x\ln(e^x) = x

Common Logarithm vs Natural Logarithm

The most frequently used logarithm bases are 10 (common logarithm) and e (natural logarithm). Understanding when to use each is important for applying logarithms correctly in different contexts.

Common logarithms (log10) are preferred in engineering, chemistry, and everyday scientific notation because they align with the decimal system. Each unit increase in log10(x) corresponds to a tenfold increase in x, making them intuitive for scales like pH, decibels, and earthquake magnitudes. For example, a pH of 3 is ten times more acidic than a pH of 4.

Natural logarithms (ln) are the default in calculus, physics, and mathematical modeling because they naturally arise from exponential growth and decay processes. The derivative of ln(x) is 1/x, and the derivative of ex is ex — no additional constants needed. This makes natural logarithms the natural choice for differential equations, compound interest, population growth, and radioactive decay models. In practice, both bases are interchangeable via the change of base formula, so choose the one that aligns with your field's conventions.

Antilogarithms

An antilogarithm (or inverse logarithm) reverses the logarithm operation. If logb(y) = x, then the antilogarithm is y = bx. In other words, the antilog raises the base to the power of the logarithm result.

antilogb(x)=bx\text{antilog}_b(x) = b^x

Antilogarithms are useful when converting from a logarithmic scale back to the original linear scale. For example, if the pH of a solution is 6, the hydrogen ion concentration is 10-6 = 0.000001 mol/L. Similarly, if a sound measures 80 dB, the actual intensity ratio is 1080/10 ≈ 108 times the reference intensity. The Log Calculator includes an antilog mode that computes bx for any base, making these conversions straightforward.

For more information, see the Scientific Notation Calculator.

Reference Tables

Common Bases

BaseNameSymbolCommon Applications
10Common Logarithmlog10(x) or log(x)Science, engineering, decibel scales
e ≈ 2.718Natural Logarithmln(x) or loge(x)Calculus, compound interest, physics
2Binary Logarithmlog2(x)Computer science, data storage, algorithms
any b ≠ 1Custom Logarithmlogb(x)Specialized mathematical applications

Logarithm of Special Values

ExpressionValueExplanation
logb(1)0Any base raised to power 0 equals 1
logb(b)1Any base raised to power 1 equals itself
logb(b2)2Following the power rule
logb(0)undefinedNo real exponent produces 0
logb(x < 1)negativeResults in negative values
limx→0⁺ logb(x)-∞Approaches negative infinity
logb(∞)Grows without bound

Logarithm Value Ranges

Argument Range (base 10)log10 ResultInterpretation
0 < x < 1NegativeValue is a fraction
x = 10Neutral element
1 < x < 100 to 1Between 0 and 1
x = 101Exactly one digit
10 < x < 1001 to 2Two digits
100 < x < 10002 to 3Three digits
10nnPower of 10 maps directly

Limitations

While logarithms are powerful mathematical tools, they have important limitations and constraints that users should understand:

  • Positive arguments only. Logarithms are only defined for positive real numbers (x > 0). You cannot calculate the logarithm of zero or negative numbers in the real number system. Attempting to do so will result in an undefined or complex result.
  • Base restrictions. The base b must be positive and not equal to 1 (b > 0 and b ≠ 1). A base of 1 would always give 1y = 1 regardless of y, making it meaningless. Negative bases create complications with non-integer exponents.
  • No real logarithm for negative results. While logarithms of negative numbers exist in the complex number system, the standard calculator focuses on real results. If you need complex logarithms, you will need specialized mathematical software.
  • Precision with very large or small numbers. When dealing with extremely large numbers (like 10100) or extremely small numbers (like 10-100), floating-point precision limitations may cause minor inaccuracies. For scientific calculations requiring extreme precision, consider using scientific notation or specialized precision tools.
  • Domain restrictions on output. The output of a logarithm can be any real number (positive, negative, or zero), but the relationship between input and output is nonlinear. This means small changes in input near 1 produce different effects than small changes in input far from 1.

Practical Applications

Logarithms are used extensively in real-world applications:

  • pH Scale in Chemistry. The pH of a solution is calculated as pH = -log10[H+], where [H+] is the hydrogen ion concentration. This converts a wide range of acid concentrations into a manageable 0–14 scale. Each whole pH unit represents a tenfold change in acidity, so a solution at pH 3 is 100 times more acidic than a solution at pH 5. The logarithmic nature of pH allows chemists to work with extreme concentration differences without dealing with unwieldy scientific notation.

  • Decibel Measurement. Sound intensity in decibels uses the formula dB = 10 × log10(P/P0), where P is the measured power and P0 is the reference power. This allows the human ear to perceive sound across an enormous range of intensities. A whisper at 30 dB is 10,000 times less intense than normal conversation at 70 dB. The logarithmic scale matches human perception because our ears respond to sound intensity logarithmically rather than linearly.

  • Richter Scale. Earthquake magnitude uses log10 to compress the enormous energy released by seismic events into a single number. Each whole number increase on the Richter scale represents approximately 31.6 times more energy release. A magnitude 6 earthquake releases about 1,000 times more energy than a magnitude 4 earthquake, even though the magnitude difference is only 2.

  • Compound Interest and Finance. The time required to double an investment at compound interest can be approximated using logarithms: t = ln(2)/ln(1 + r), where r is the interest rate. For example, at a 7% annual return, the doubling time is ln(2)/ln(1.07) ≈ 10.2 years. Financial analysts also use logarithms to model continuously compounding interest and to calculate logarithmic returns, which provide a more symmetric view of gains and losses than simple percentage returns.

  • Algorithms and Computer Science. Binary search, heap operations, and many divide-and-conquer algorithms have time complexity expressed in terms of log2(n), making logarithms essential for analyzing computational efficiency. For example, searching a sorted list of 1 million items requires only about 20 comparisons using binary search, because log2(1,000,000) ≈ 20. In information theory, the entropy of a data source is measured in bits using log2, quantifying the average information content per symbol.

Tips for Working with Logarithms

  • Check your base. Always confirm which base you are using before interpreting results. In many scientific contexts, log written without a base defaults to base 10, while in advanced mathematics it often defaults to base e. The Log Calculator always shows the base explicitly.
  • Use the change of base rule. Most basic calculators only support log10 and ln. If you need log2(x), compute ln(x)/ln(2) or log10(x)/log10(2). The Log Calculator handles this automatically.
  • Verify domain constraints. Always ensure your argument is positive (x > 0) and your base is positive and not 1. A common mistake is attempting to compute log(0) or log(-5), which are undefined in the real number system.
  • Estimate before computing. For rough approximations, remember that log10(10n) = n and ln(en) = n. This helps you quickly verify whether a calculated result is in the right ballpark.
  • Think in orders of magnitude. When working with common logs, focus on the magnitude rather than exact values. log10(5 × 106) ≈ 6.7, meaning the value is roughly 106.7 ≈ 5 million. This mental model helps when comparing very large or very small numbers.
  • Use log-log plots for power relationships. When data follows a power law (y = axb), plotting log(y) vs log(x) produces a straight line with slope b. This technique is invaluable in data analysis and scientific research.

Frequently Asked Questions

What is the difference between log and ln?
Log can use any positive base. Ln always uses Euler's number e as the base. For example, log10(100) = 2, but ln(100) ≈ 4.605.
Can I compute a logarithm with a custom base?
Yes. Enter any positive base (except 1) and positive argument. Uses change-of-base: log_b(x) = ln(x) / ln(b).
What is an antilog and how do I use it?
Antilog is the inverse of a logarithm. If log_b(y) = x, then y = b^x. Select antilog mode and enter base and exponent.
What happens if I enter zero or a negative number?
Logarithms are only defined for positive real arguments (x > 0) and positive bases other than 1. Invalid inputs produce an error.
Why use this instead of a scientific calculator?
It shows step-by-step breakdowns, supports very large/small numbers via scientific notation, and works in any browser.
What is the relationship between logarithms and exponents?
They are inverse operations. If b^y = x, then log_b(x) = y. The logarithm tells you what exponent y raises base b to produce x.
Why do logs of numbers between 0 and 1 produce negative results?
Because any positive base raised to a negative exponent yields a fraction. For example, 10⁻¹ = 0.1, so log₁₀(0.1) = -1. As the argument approaches zero, the logarithm approaches negative infinity.
What is the domain and range of a logarithmic function?
The domain is all positive real numbers (x > 0). The range is all real numbers from negative to positive infinity. Logarithms are undefined for zero and negative numbers in the real number system.
How are logarithms used in information theory and data compression?
In information theory, log₂(p) measures the information content of an event with probability p. Entropy is the average of these log terms across all possible symbols, forming the mathematical foundation of data compression, error correction, and machine learning.

Last updated: July 10, 2026

UB

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy