Log Calculator
Calculate logarithms in any base: log base 10, natural log (ln), log base 2 or a custom base. Shows the steps, a verification b^y = x and the other bases.
Logarithm Calculator
Calculate logarithms with any base, including common logarithms (base 10), natural logarithms (base e), and binary logarithms (base 2). This calculator provides detailed results with step-by-step explanations and supports both exact and approximate values.
Input Values
Log Calculator
Many people assume "log" always means base 10 and that log(100) and ln(100) give the same answer. They don't. The log calculator handles base 10 (common log), base e (natural log), base 2 (binary log), and any custom positive base except 1. It returns the exponent to which the base must be raised to produce your number, and it verifies the result by raising the base to that exponent. You get both an exact answer when one exists and an approximate one to the decimal place you choose.
- Formula: log_b(x) = y if and only if b^y = x
- Domain: Argument x must be > 0. Base b must be > 0 and b ≠ 1.
- Common Log: Base 10, written log₁₀(x) or log(x). Used in pH and Richter scale.
- Natural Log: Base e (≈2.71828), written ln(x). Used in calculus and exponential growth.
- Binary Log: Base 2, written log₂(x) or lb(x). Used in computer science.
- ISO Notation: ISO 80000-2:2019 defines lb = log₂, lg = log₁₀, ln = logₑ.
How To Use The Calculator To Get A Logarithm
Select the logarithm type first. The four options are Common Log (base 10), Natural Log (base e), Binary Log (base 2), and Custom Base. When you pick a preset, the base input locks to the correct value. For Custom Base, type any positive number other than 1. Then enter the number (the argument) whose logarithm you want. The number must be greater than 0.
Set the decimal places from 0 to 10. The default is 4, which matches the precision of a four-figure log table. Check "Show calculation steps" to see the change-of-base calculation, the definition applied, and the verification that b^y equals x. Check "Show logarithm properties" to see which rules apply to your specific inputs, such as the zero property when x=1 or the identity property when x=b.
Click Calculate. The result displays in three forms: the numeric answer, the logarithmic notation (for example, log₁₀(100) = 2), and alternate forms in the other common bases. The verification line shows b^result and confirms it matches the original number within floating-point precision.
Reset clears all inputs and results. The calculator returns to Custom Base with base 10 and number 100, which is a known starting point for quick checking.
What The Answer Means: Log Form To Exponential Form
The calculator answers one question: what exponent y satisfies b^y = x? The statement log_b(x) = y is equivalent to b^y = x. If the result is 3, then raising the base to the power 3 equals the number you entered. If the result is -2, then raising the base to the power -2 (which is 1/b²) equals the number.
Verification
The calculator always shows b^result and checks that it reproduces the original number. For example, if you calculate log₁₀(0.01), the result is -2 and the verification shows 10⁻² = 0.01. If the result is an integer (within floating-point tolerance), the calculator labels it an exact value. Otherwise it gives an approximate value to the chosen decimal places.
Interpreting Negative Results
A negative logarithm does not mean the argument is negative. It means the argument is between 0 and 1. For example, log₁₀(0.5) ≈ -0.3010 because 10⁻⁰·³⁰¹⁰ ≈ 0.5. The calculator accepts numbers between 0 and 1 and returns the correct negative exponent.
Which Base: Log, Ln, And Log₂
Each base serves a different field. Choosing the wrong one gives a mathematically valid answer that does not solve your problem.
Common Log (log, base 10)
This is the log key on most basic scientific calculators. Use it for pH calculations (pH = -log₁₀[H⁺]), the Richter scale (each whole number step multiplies amplitude by 10 and energy by about 31.6), and decibel levels (dB = 10 log₁₀(P/P₀)). In Excel, the function LOG10(number) returns the base-10 log.
Natural Log (ln, base e)
The natural logarithm uses Euler's number e ≈ 2.71828 as its base. It appears in calculus because d/dx ln(x) = 1/x and in models of exponential growth, radioactive decay, and compound interest over continuous time. In Excel, the function LN(number) returns the natural log. In pure mathematics, "log" often means ln, which contradicts the calculator convention. Check the notation of the source you are reading.
Binary Log (log₂, base 2)
Binary logarithms measure the number of times you can halve a quantity before reaching 1. Computer science uses log₂ to express algorithm complexity: an O(log₂ n) algorithm does about log₂ n steps for n inputs. The CLRS textbook "Introduction to Algorithms" uses lg to mean log₂. In Excel, you can get log₂ by using LOG(number, 2) or by dividing ln(x) by ln(2).
Custom Base
Select Custom Base when your problem specifies a base other than 10, e, or 2. The calculator applies the change-of-base formula internally: log_b(x) = ln(x) / ln(b). This works for any positive base except 1.
| Type | Base | Common Notation | ISO 80000-2 Notation | Primary Field |
|---|---|---|---|---|
| Common log | 10 | log(x) or log₁₀(x) | lg(x) | Chemistry (pH), geology (Richter scale), sound (decibel) |
| Natural log | e (≈2.71828) | ln(x) or logₑ(x) | ln(x) | Calculus, physics, exponential growth/decay |
| Binary log | 2 | log₂(x) or lb(x) | lb(x) | Computer science (algorithm complexity, information theory) |
| Custom base | Any positive b ≠ 1 | log_b(x) | Not defined | Any field requiring a specific base |
Worked Examples
Example 1: Common Log Of 1000
Select Common Log (base 10). Enter number 1000. The calculator returns log₁₀(1000) = 3. Verification: 10³ = 1000. The result is exact because 10³ exactly equals 1000. The alternate forms show ln(1000) ≈ 6.9078 and log₂(1000) ≈ 9.9658. If you needed the binary log of 1000 for computer memory analysis, you would use the log₂ selector instead, which returns about 9.9658, not 3.
Example 2: Natural Log Of 5 With Step Display
Select Natural Log (base e). Enter number 5. Set decimal places to 4. Check "Show calculation steps". The calculator applies the definition: find y such that e^y = 5. Since no integer y satisfies that, the calculator uses the natural log function directly: ln(5) ≈ 1.6094.The steps display the identity property: ln(e) = 1, so ln(5) is between 1 and 2. The alternate forms give log₁₀(5) ≈ 0.6990 and log₂(5) ≈ 2.3219.
Example 3: Binary Log Of 64 Using Custom Base
Select Binary Log (base 2). Enter number 64. The calculator returns log₂(64) = 6 exactly, because 2⁶ = 64. Now try the same with Custom Base: set base to 2 and number to 64. The calculator uses the change-of-base formula: log₂(64) = ln(64)/ln(2) = 4.1589/0.6931 = 6. The result is the same. This shows that the preset bases are convenience shortcuts; the underlying calculation is identical.
Common Questions
What happens if I try to take the log of 0 or a negative number?
The calculator rejects it. Real logarithms are defined only for positive arguments. As the argument approaches 0 from the positive side, the logarithm approaches negative infinity. For negative numbers, the logarithm is not a real number at all. The same restriction applies to the base: it must be positive and not equal to 1.
What is the difference between log and ln?
Log (common log) uses base 10. Ln (natural log) uses base e, which is approximately 2.71828. The numerical values differ by a constant factor: ln(x) = log₁₀(x) × ln(10) ≈ log₁₀(x) × 2.3026. Using the wrong one in a formula like pH or the Richter scale gives an incorrect answer. In some higher mathematics texts, "log" means ln, so always confirm the notation in the source you are using.
Why can't the base be 1?
A logarithm with base 1 is undefined because 1 raised to any power equals 1. There is no exponent y such that 1^y = x when x ≠ 1. When x = 1, any y works, which is equally useless. The calculator rejects base 1 and prompts you to enter a different base.
How do I calculate log_b(x) on a calculator that only has log and ln keys?
Use the change-of-base formula: log_b(x) = log(x) / log(b) or log_b(x) = ln(x) / ln(b). Both give the same result because the ratio cancels the base. For example, to calculate log₂(50) using only the ln key, compute ln(50) / ln(2) ≈ 3.9120 / 0.6931 ≈ 5.6439. The log calculator does that internally when you select a custom base.
Can the result of a logarithm be negative?
Yes. The logarithm is negative whenever the argument is between 0 and 1. For example, log₁₀(0.1) = -1 because 10⁻¹ = 0.1, and ln(0.5) ≈ -0.6931 because e⁻⁰·⁶⁹³¹ ≈ 0.5. The calculator handles this correctly. A negative result does not mean the input was negative; it means the input is less than 1.