Log Calculator
A log calculator is a mathematical tool designed to compute the logarithm of a number with respect to any base, including common logarithms (base 10) and natural logarithms (base e, represented as ln). Logarithms represent the inverse operation of exponentiation, determining the exponent to which a base must be raised to produce a given value. The calculator solves logarithmic equations and converts expressions between exponential and logarithmic forms. Scientists, financial analysts, and computer programmers use it to solve growth models, calculate decibels or pH levels, and simplify complex exponential calculations.
Pick a mode, enter the values, and the calculator returns the logarithm with the formula and an equivalent exponent statement. Supports custom-base logarithms, common log (log₁₀), natural log (ln), and solving for the missing exponent in b^y = x.
Quick Answer
Calculate logarithms for any base, including log base 2, common logs (log10), and natural logs (ln). Enter the number and base to get the exponent instantly.
Mode
The number to take the logarithm of. Must be greater than 0. · e.g. 8
The base of the logarithm. Must be greater than 0 and not equal to 1. · e.g. 2
log_2(x)
3
Exact: 2^3 = 8
8 is exactly 2^3, so log base 2 of 8 is exactly 3. No rounding is involved.
Examples
log₂(8)
= 3 · because 2³ = 8
log₁₀(1000)
= 3 · because 10³ = 1000
ln(e)
= 1 · because e¹ = e
Solve 2^y = 16
y = 4 (log₂(16))
How it works
Formula · log_b(x) = ln(x) ÷ ln(b) · log₂(x) = ln(x) ÷ ln(2)
A logarithm is the inverse of an exponent. It asks: what exponent must a base b be raised to in order to produce a value x?
Definition
log_b(x) = y means b^y = x
Common log
log₁₀(x) is the exponent for base 10
Natural log
ln(x) is the exponent for base e
Change of base
log_b(x) = ln(x) / ln(b)
The calculator uses the change-of-base formula internally for custom bases. The result is rounded for display; the calculation runs in standard floating-point precision.
Learn the concept
These guides explain the constant and the operation this tool runs, with worked examples.
What is a log calculator?
A log calculator finds the exponent that a base must be raised to in order to produce a target value. It runs the standard logarithm in any base, the common log (base 10), the natural log (base e), and works in reverse to solve for the missing exponent in an exponential equation.
Log base 2, the binary logarithm
Written log₂(x) in mathematics, log2(x) in most programming languages and spreadsheets, and lg(x) in computer science texts. All three name the same operation: the number of times you can halve x before reaching 1.
log₂(x) asks how many times 1 has to double to reach x. Select Log base 2 (binary) above and the base is pinned to 2, so it stays put while you change the value.
log₂(x) = ln(x) ÷ ln(2) = log₁₀(x) ÷ log₁₀(2)
That rearrangement is the change of base formula, and it is how any base gets computed from the two a calculator provides natively. Worked through: log₂(8) = ln(8) ÷ ln(2) = 2.079442 ÷ 0.693147 = 3. Because 8 is a whole power of 2, the calculator reports the exact integer 3 rather than a decimal that merely rounds to it.
Base 2 is the working base of computer science. A quantity that doubles each step needs log₂(n) steps to reach n, which is why binary search and balanced-tree operations are described as O(log n). A choice between 256 equally likely options carries log₂(256) = 8 bits of information. ISO 80000-2 also writes this function as lb(x).
| Power | Value x | log₂(x) |
|---|---|---|
| 2^0 | 1 | 0 |
| 2^1 | 2 | 1 |
| 2^2 | 4 | 2 |
| 2^3 | 8 | 3 |
| 2^4 | 16 | 4 |
| 2^5 | 32 | 5 |
| 2^8 | 256 | 8 |
| 2^10 | 1,024 | 10 |
| 2^16 | 65,536 | 16 |
| 2^20 | 1,048,576 | 20 |
| 2^-1 | 0.5 | -1 |
Values between two rows land between their exponents: log₂(9) is 3.169925, just above log₂(8) = 3. Values below 1 give negative answers, because reaching them means halving rather than doubling, which is why log₂(0.5) = -1. log₂(0) and the logarithm of any negative number do not exist as real numbers, so the calculator rejects both rather than returning negative infinity or NaN.
How the log calculator works
Pick a mode and enter the inputs:
- Log with custom base: enter a value and a base. The calculator returns log_b(x) using the change-of-base formula log_b(x) = ln(x) / ln(b).
- Common log: enter a value. The calculator returns log₁₀(x).
- Natural log: enter a value. The calculator returns ln(x) = log_e(x).
- Solve missing exponent: enter a base and a result. The calculator returns the exponent y such that b^y = result, using the same change-of-base formula.
Every mode also shows the equivalent exponent statement and a plain English explanation, so you can see the relationship from both sides.
Log formula
The defining relationship is log_b(x) = y if and only if b^y = x. The change-of-base formula expresses any logarithm in terms of natural log or common log:
- log_b(x) = ln(x) / ln(b)
- log_b(x) = log₁₀(x) / log₁₀(b)
A handful of identities make hand calculation easier. The last three have names, and the names are worth knowing: a rule you can name is a rule you can look up.
- log_b(1) = 0 for any base
- log_b(b) = 1 for any base
- log_b(x · y) = log_b(x) + log_b(y) Product rule
- log_b(x / y) = log_b(x) − log_b(y) Quotient rule
- log_b(x^k) = k · log_b(x) Power rule
The product rule is why logarithms were invented: it turns a multiplication into an addition, which is the whole trick behind slide rules and log tables. The power rule is the one that solves equations, because it pulls an unknown exponent down out of the exponent position and into a coefficient you can divide by.
Logs vs exponents
Logarithms and exponents are inverse operations. An exponent raises a base to a power by repeated multiplication. A logarithm asks the opposite question: given a base and a result, what exponent produces the result?
- Exponent: 2^3 = 8 (base 2, exponent 3, result 8)
- Logarithm: log₂(8) = 3 (base 2, result 8, exponent 3)
Both statements describe the same relationship from different directions. Use the exponent calculator when the base and exponent are known and you want the result. Use this log calculator when the base and result are known and you want the exponent. The Solve missing exponent mode in this calculator is exactly the logarithm framed as the inverse of exponentiation.
Common log vs natural log
The common log uses base 10 and is the standard tool in chemistry (pH), audio (decibels), and earthquake magnitude (Richter scale). The natural log uses base e (about 2.71828) and is the standard tool in calculus, continuous growth and decay, and many physics formulas. Both are special cases of the general logarithm; the calculator exposes each as its own mode for convenience.
When a math text writes plain log without a base, it usually means log₁₀ in introductory and engineering settings, or ln in some pure-math settings. The calculator labels each mode explicitly so there is no ambiguity in the result.
Worked examples
- log₂(8) = 3, because 2 × 2 × 2 = 8.
- log₁₀(1000) = 3, because 10 × 10 × 10 = 1000.
- log₁₀(0.01) = −2, because 10^(−2) = 1 / 100 = 0.01.
- ln(e) = 1, because e^1 = e.
- ln(1) = 0 for any base.
- log₂(16) = 4, the answer to 2^y = 16.
Common mistakes
- Taking a log of zero or a negative number. Logarithms are only defined for positive real values. The calculator flags these cases.
- Using a base of 1. Every power of 1 is 1, so the logarithm with base 1 has no unique answer; the base must be greater than 0 and not equal to 1.
- Confusing log with ln. In most introductory and engineering contexts, log means base 10, and ln means base e. The calculator labels each mode so the base is always explicit.
- Treating log_b(x + y) as log_b(x) + log_b(y). The log of a sum is not the sum of logs. The product rule applies to products: log_b(x · y) = log_b(x) + log_b(y).
- Forgetting that log_b(x^k) = k · log_b(x) pulls the exponent out front. This is the identity most useful for solving exponential equations.
Where logarithms show up
Logarithms appear any time you need to solve for an exponent, compress a wide range of values onto a readable scale, or model exponential change. Common applications include pH and decibel scales, the Richter scale, half-life and continuous-growth formulas, information theory (bits use log base 2), and algorithm analysis (O(log n) complexity). They also show up in the compound-interest formula when you solve for time.
Related tools
- Scientific calculator for a full button-driven calculator with log, ln, sin, cos, tan, and exponents in one place.
- Change of Base Formula
- Exponent calculator runs the inverse operation: base raised to a power.
- Square root calculator for the special case of the 1/2 power.
- Factor calculator for prime factorization, factor pairs, and the greatest common factor.
- All education calculators.
Note. Logarithms are defined only for positive real values. Negative, zero, and base-of-1 cases are flagged in the result panel with a short explanation rather than returned as NaN. Results are rounded for display; the calculation runs in standard floating-point precision.
Related Calculators
More tools from Education



