Logarithm Calculator
Calculate logarithms in any base — common (base 10), natural (base e), binary (base 2), or custom base.
Did this tool work for you?
How to use this calculator
Any logarithm can be computed from the natural log using the change-of-base formula.
- 1
Enter the number you want to take the logarithm of.
- 2
Select the base: base 10 (common log), base e (natural log), base 2 (binary), or custom.
- 3
For a custom base, enter it in the custom base field.
- 4
The result shows your chosen log plus common/natural/binary logs for reference.
Frequently asked questions
Why can’t I take the log of zero or a negative number?
For a positive base, bᵖ is always greater than zero, so no real exponent produces 0 or a negative result. The calculator therefore returns “x must be a positive number” for any x ≤ 0. Complex-number logarithms of negatives are not supported.
Which bases are not allowed?
The base must be positive and cannot equal 1, because 1 raised to any power is 1 and the exponent would be undefined. A base between 0 and 1 is accepted; log base 0.5 of 8 is -3, because (1/2)⁻³ = 8. Zero and negative bases return an error.
What is the difference between log, ln and log₂?
Conventions vary. Here the select labels are: base 10 (common log), base e (natural log, ln, with e ≈ 2.71828) and base 2 (binary log). Many textbooks write “log” for base 10, but programming languages often use log for the natural log. The calculator always prints the base in the result label, e.g. log10(1000) or loge(10), and always shows ln, log₁₀ and log₂ of your x below it.
What does the custom base field do when another base is selected?
Nothing. The custom base value is read only when you choose “Custom base”. Leaving 3 in the field while base 10 is selected does not change the answer.
How are results rounded?
Logarithms are rounded to 8 decimal places and trailing zeros are dropped, so exact answers such as log₁₀(1000) display as 3. Irrational results such as log₁₀(2) = 0.30103 are truncated representations, not exact values. The antilog row raises the base to the result as a sanity check and shows about ten significant digits.
Can I enter very small numbers?
Yes. Scientific notation works: 1e-7 gives log₁₀ = -7. The antilog check row shows it back as 1e-7. A log of a number between 0 and 1 is negative, and the log of exactly 1 is 0 in every base.
How do I find the number of digits or bits needed?
For whole numbers, the number of decimal digits is floor(log₁₀ n) + 1, and the number of bits is floor(log₂ n) + 1. For 1,000,000 values, log₂ is 19.93156857, so 20 bits are needed. The calculator gives the logarithm; you apply the floor and the +1 yourself.
Does it solve equations like 3ˣ = 20?
Indirectly. Choose x = 20 and a custom base of 3: the result is the exponent. It does not solve multi-term logarithmic or exponential equations.
Logarithm calculator — any base from one number
How the result is computed
A logarithm answers the question “what power of the base gives x?”. In symbols, logₐ(x) = y means aʸ = x. The calculator uses the change-of-base rule, logₐ(x) = ln(x) ÷ ln(a), so any positive base other than 1 works. Alongside your chosen log it prints log₁₀, ln and log₂ of the same x, plus an antilog line that raises the base to the answer to confirm it returns x.
Worked examples
Figures below came from running the tool.
| Input x | Base | Result | Meaning |
|---|---|---|---|
| 1000 | 10 | 3 | 10³ = 1000 |
| 1024 | 2 | 10 | 2¹⁰ = 1024 |
| 10 | e | 2.30258509 | ln 10 |
| 81 | 3 (custom) | 4 | 3⁴ = 81 |
| 0.001 | 10 | -3 | 10⁻³ = 0.001 |
| 8 | 0.5 (custom) | -3 | (1/2)⁻³ = 8 |
Growth and doubling time
A quantity growing 7 percent per period multiplies by 1.07 each time. To find how many periods it takes to double, ask what power of 1.07 equals 2: enter x = 2 with custom base 1.07. The calculator returns 10.24476835, so just over ten periods. The same exponent idea applies to any steady percentage growth, and any change of base gives the same answer, e.g. ln 2 ÷ ln 1.07.
Where logarithmic scales appear
Powers of ten become evenly spaced steps on a log scale. The pH of a solution is defined as the negative base-10 logarithm of the hydrogen-ion concentration, so a concentration of 1e-7 gives log₁₀ = -7 and a pH of 7. Decibels are 10 × log₁₀ of a power ratio. In computing, log₂ counts bits: one million distinct values needs log₂(1,000,000) = 19.93156857, rounded up to 20 bits.
Rules worth remembering
log(xy) = log x + log y, log(x ÷ y) = log x − log y, and log(xⁿ) = n × log x. Every base satisfies log(1) = 0 and logₐ(a) = 1. Only positive inputs are valid, and the base can be any positive number except 1, including fractions below 1, which simply flip the sign of the result compared with the matching base above 1. Results are shown to 8 decimal places, and log₂ of an exact power of two comes out as a whole number.
Learn more from an authoritative source:
WikipediaExponent Calculator
Calculate any base raised to any power. Handles large exponents, fractional powers (roots), and negative exponents.
Linear Equation Solver
Solve a system of two linear equations with two unknowns using substitution or Cramer's rule.
Modulo Calculator
Calculate the remainder of division (modulo operation). Supports positive and negative numbers and shows the full division breakdown.
Rectangle Calculator
Calculate area, perimeter, diagonal, and aspect ratio of a rectangle or square.
Mean, Median & Mode Calculator
Calculate mean, median, mode, range, and variance for a set of numbers. Enter up to 20 values.
Number Sequence Calculator
Identify and continue arithmetic and geometric sequences. Find the nth term and sum of the first n terms.
Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →