Logarithm Calculator Step by Step: Log Base 10, Natural Log, and Any Base Explained
A logarithm answers one specific question: what exponent produces this number? When you write log base 10 of 1000 = 3, you are saying that 10 raised to the power 3 equals 1000. When you write ln(20.09) = 3, you are saying that e raised to the power 3 equals approximately 20.09. Every logarithm problem reduces to that single question, and once that definition is internalized, every logarithm rule follows from it without memorization. Logarithms appear wherever quantities span enormous ranges - sound intensity, earthquake magnitude, acidity, stellar brightness, information theory, and continuous compound growth all use logarithmic scales because they compress numbers that would otherwise range from 0.000000000001 to 1,000,000,000,000 into a manageable 0 to 12. This guide explains every logarithm rule from first principles, works through complete examples for every case, and shows how to use the logarithm calculator at CalcAdvisor.com when solving a logarithm calculator step by step problem.
What a Logarithm Is and the Relationship Between Logs and Exponents
The logarithm and the exponential function are inverses of each other, exactly as subtraction is the inverse of addition and division is the inverse of multiplication. Every logarithm statement can be rewritten as an exponential statement, and vice versa.
The general form: log base b of x = y means exactly the same thing as b^y = x. The base b, the exponent y, and the result x are the same three numbers in both statements - only the arrangement changes. This equivalence is not a rule to memorize; it is the definition of what a logarithm is.
Three specific bases appear in practice:
Base 10 (common logarithm, written log or log10): log(1000) = 3 because 10^3 = 1000. log(0.01) = -2 because 10^(-2) = 0.01. Used in pH, decibels, the Richter scale, and any field where quantities differ by factors of 10.
Base e (natural logarithm, written ln): ln(e) = 1 because e^1 = e. ln(1) = 0 because e^0 = 1. ln(7.389) = 2 because e^2 = 7.389. Used in continuous compound interest, population growth, radioactive decay, and all of calculus. The constant e (approximately 2.71828) is the unique base for which the derivative of the exponential function equals itself - which makes it the natural choice throughout mathematics and physics.
Base 2 (binary logarithm, written log2 or lb): log2(64) = 6 because 2^6 = 64. log2(1024) = 10 because 2^10 = 1024. Used in information theory, computer science, and binary systems. The number of bits required to represent n states is log2(n).
Two special values hold for any base: log_b(1) = 0 because b^0 = 1 for any b. log_b(b) = 1 because b^1 = b. These are worth remembering as instant sanity checks.
The Five Logarithm Rules and Why Each One Is True
Every logarithm rule is a direct consequence of the corresponding exponent rule, translated through the log-exponent equivalence. Understanding the derivation makes each rule obvious rather than arbitrary.
Rule 1: Product Rule - log_b(M x N) = log_b(M) + log_b(N)
Let log_b(M) = p and log_b(N) = q. Then M = b^p and N = b^q. So M x N = b^p x b^q = b^(p+q) by the exponent product rule. Therefore log_b(M x N) = p + q = log_b(M) + log_b(N). Logarithms convert multiplication into addition - which is historically why they were invented, to reduce the labor of multiplying large numbers before calculators existed.
Rule 2: Quotient Rule - log_b(M / N) = log_b(M) - log_b(N)
Same setup: M = b^p, N = b^q. M/N = b^p / b^q = b^(p-q). Therefore log_b(M/N) = p - q = log_b(M) - log_b(N). Logarithms convert division into subtraction.
Rule 3: Power Rule - log_b(M^n) = n x log_b(M)
M^n = (b^p)^n = b^(pn). Therefore log_b(M^n) = pn = n x log_b(M). Logarithms convert exponentiation into multiplication. This is the rule that makes logarithms useful for solving equations where the unknown is an exponent.
Rule 4: Change of Base Formula - log_b(x) = log(x) / log(b) = ln(x) / ln(b)
Let log_b(x) = y, so b^y = x. Take the common log of both sides: log(b^y) = log(x). Apply the power rule: y x log(b) = log(x). Solve for y: y = log(x) / log(b). This formula lets you compute any logarithm using only the base-10 or natural log buttons available on every calculator.
Rule 5: Inverse Relationship - b^(log_b(x)) = x and log_b(b^x) = x
These follow directly from the definition. If log_b(x) = y means b^y = x, then substituting back: b^(log_b(x)) = b^y = x. And log_b(b^x) = x because b^x raised to the log base b gives x back. These inverse relationships are used constantly to solve exponential and logarithmic equations: to undo a log, exponentiate; to undo an exponential, take a log.
The Formula Explained With a Full Worked Example
The core formula: log_b(x) = log(x) / log(b), where log is any logarithm (typically base 10 or natural log). Here are five complete examples covering every case.
Example 1: Base-10 logarithm of a whole number - log(500)
Step 1: 500 is not a power of 10, so the answer will not be a whole number. Use the fact that log(500) = log(5 x 100) = log(5) + log(100).
Step 2: log(100) = 2 (because 10^2 = 100).
Step 3: log(5) = log(10/2) = log(10) - log(2) = 1 - 0.3010 = 0.6990.
Step 4: log(500) = 0.6990 + 2 = 2.6990.
Verify: 10^2.6990 = 10^2 x 10^0.6990 = 100 x 5.000 = 500. Correct.
Example 2: Natural logarithm - ln(150)
Step 1: ln(150) = ln(6 x 25) = ln(6) + ln(25).
Step 2: ln(25) = ln(5^2) = 2 x ln(5) = 2 x 1.6094 = 3.2189.
Step 3: ln(6) = ln(2 x 3) = ln(2) + ln(3) = 0.6931 + 1.0986 = 1.7918.
Step 4: ln(150) = 1.7918 + 3.2189 = 5.0106.
Verify: e^5.0106 = 150.0 (to 4 significant figures). Correct.
Example 3: Change of base - log base 5 of 200
Step 1: Apply change of base: log_5(200) = log(200) / log(5).
Step 2: log(200) = log(2 x 100) = log(2) + 2 = 0.3010 + 2 = 2.3010.
Step 3: log(5) = 0.6990 (from Example 1 above).
Step 4: log_5(200) = 2.3010 / 0.6990 = 3.2918.
Verify: 5^3.2918 = 5^3 x 5^0.2918 = 125 x 1.6000 = 200.0. Correct.
Example 4: Logarithm of a decimal - log(0.0035)
Step 1: Write in scientific notation: 0.0035 = 3.5 x 10^(-3).
Step 2: log(3.5 x 10^(-3)) = log(3.5) + log(10^(-3)) = log(3.5) + (-3).
Step 3: log(3.5) = log(7/2) = log(7) - log(2) = 0.8451 - 0.3010 = 0.5441.
Step 4: log(0.0035) = 0.5441 - 3 = -2.4559.
Verify: 10^(-2.4559) = 10^(-3) x 10^(0.5441) = 0.001 x 3.500 = 0.0035. Correct.
Example 5: Solving an exponential equation using logarithms
Solve 3^x = 85.
Step 1: Take log of both sides: log(3^x) = log(85).
Step 2: Apply the power rule: x x log(3) = log(85).
Step 3: x = log(85) / log(3) = 1.9294 / 0.4771 = 4.0437.
Verify: 3^4.0437 = 3^4 x 3^0.0437 = 81 x 1.0494 = 85.00. Correct.
This is the most important practical use of logarithms: whenever the unknown is in an exponent, take the log of both sides and bring the exponent down using the power rule.
Logarithm Values and Rules Quick Reference Table
| Expression | Value | Reasoning |
|---|---|---|
| log(1) | 0 | 10^0 = 1 |
| log(10) | 1 | 10^1 = 10 |
| log(100) | 2 | 10^2 = 100 |
| log(1000) | 3 | 10^3 = 1000 |
| log(0.1) | -1 | 10^(-1) = 0.1 |
| log(0.01) | -2 | 10^(-2) = 0.01 |
| ln(1) | 0 | e^0 = 1 |
| ln(e) | 1 | e^1 = e |
| ln(e^2) | 2 | e^2 = e^2 |
| log2(1) | 0 | 2^0 = 1 |
| log2(2) | 1 | 2^1 = 2 |
| log2(8) | 3 | 2^3 = 8 |
| log2(1024) | 10 | 2^10 = 1024 |
| log(M x N) | log(M) + log(N) | Product rule |
| log(M / N) | log(M) - log(N) | Quotient rule |
| log(M^n) | n x log(M) | Power rule |
| log_b(x) | log(x) / log(b) | Change of base |
How to Use This Calculator on CalcAdvisor.com
Open the Logarithm Calculator at https://www.calcadvisor.com/calculators/logarithm-calculator. You will see two input fields: one for the value (the number you want the logarithm of) and one for the base.
For common log (base 10): enter your value and set the base to 10. For log(750), enter 750 and base 10. Result: 2.8751.
For natural log (base e): enter your value and set the base to e (the calculator accepts the letter e or the value 2.71828). For ln(750), enter 750 and base e. Result: 6.6201.
For any other base: enter the value and the base directly. For log base 7 of 500, enter 500 and base 7. The calculator applies the change of base formula internally and returns 3.2091.
The calculator also returns the antilogarithm verification: for log base 10 of 750 = 2.8751, it shows 10^2.8751 = 750, confirming the result. This makes it easy to verify that the log and exponent relationship is consistent.
For solving exponential equations like 5^x = 340, use the calculator in two steps: compute log(340) / log(5) = 2.5315 / 0.6990 = 3.6219. The answer is x = 3.6219. Verify by computing 5^3.6219 on the exponent calculator at CalcAdvisor.com - the result should be 340.
3 Real-World Examples
Example 1 - Chemistry: Calculating pH
The pH of a solution measures its acidity using the formula pH = -log([H+]), where [H+] is the hydrogen ion concentration in moles per liter. A sample of black coffee has a hydrogen ion concentration of 1.26 x 10^(-5) mol/L. What is its pH?
Step 1: log(1.26 x 10^(-5)) = log(1.26) + log(10^(-5)) = log(1.26) - 5.
Step 2: log(1.26) = 0.1004 (since 10^0.1004 = 1.26).
Step 3: log(1.26 x 10^(-5)) = 0.1004 - 5 = -4.8996.
Step 4: pH = -(-4.8996) = 4.90.
Black coffee has a pH of approximately 4.90, confirming it is acidic (pH below 7 is acidic, pH above 7 is alkaline, pH = 7 is neutral). For comparison, pure water has [H+] = 10^(-7), giving pH = -log(10^(-7)) = 7.00. Orange juice at [H+] = 2.51 x 10^(-4) has pH = -log(2.51 x 10^(-4)) = -(-3.600) = 3.60 - noticeably more acidic than coffee.
Example 2 - Finance: Solving for the time to double an investment
You invest $10,000 at 8% annual interest, compounded annually. After how many years does the investment double to $20,000?
The compound interest formula: A = P x (1 + r)^t. Set A = 20,000, P = 10,000, r = 0.08.
Step 1: 20,000 = 10,000 x (1.08)^t. Divide both sides by 10,000: 2 = (1.08)^t.
Step 2: Take log of both sides: log(2) = t x log(1.08).
Step 3: t = log(2) / log(1.08) = 0.3010 / 0.03342 = 9.006 years.
The investment doubles in approximately 9 years. This is consistent with the Rule of 72 approximation: 72 / 8 = 9 years. The logarithm gives the exact answer; the Rule of 72 is a mental math shortcut that gives the same result to within a few months for typical interest rates.
At 6%: t = log(2) / log(1.06) = 0.3010 / 0.02531 = 11.90 years. At 12%: t = 0.3010 / 0.04922 = 6.12 years. The logarithm is the only way to solve exactly for time when the unknown is in the exponent of a compound growth formula.
Example 3 - Acoustics: Sound levels and the decibel scale
The decibel level of a sound is dB = 10 x log(I / I_0), where I is the sound intensity in watts per square meter and I_0 = 10^(-12) W/m^2 is the threshold of human hearing. Three sounds have intensities of 10^(-10), 10^(-6), and 10^(-2) W/m^2. What are their decibel levels, and how does a tenfold increase in intensity affect the decibel reading?
Sound 1: dB = 10 x log(10^(-10) / 10^(-12)) = 10 x log(10^2) = 10 x 2 = 20 dB. (Quiet whisper at 1 meter.)
Sound 2: dB = 10 x log(10^(-6) / 10^(-12)) = 10 x log(10^6) = 10 x 6 = 60 dB. (Normal conversation.)
Sound 3: dB = 10 x log(10^(-2) / 10^(-12)) = 10 x log(10^10) = 10 x 10 = 100 dB. (Motorcycle at 5 meters.)
A tenfold increase in intensity: if I increases by a factor of 10, then log(10I / I_0) = log(10) + log(I / I_0) = 1 + log(I / I_0). Multiplied by 10: the decibel level increases by exactly 10 dB. So going from a whisper (20 dB) to normal conversation (60 dB) represents a 10,000-fold (10^4) increase in physical sound intensity, even though the decibel numbers only differ by 40. This is why logarithmic scales exist: they make enormous ranges of physical quantities humanly interpretable.
Common Mistakes to Avoid
1. Confusing log (base 10) with ln (base e). log(100) = 2 because 10^2 = 100. ln(100) = 4.6052 because e^4.6052 = 100. These are completely different values. The relationship between them is ln(x) = log(x) x ln(10) = log(x) x 2.3026. In science and engineering, "log" sometimes means natural log in certain fields (particularly chemistry and physics) while meaning base 10 in others. Always confirm which base is intended before calculating.
2. Applying the product rule to log(M + N). log(M x N) = log(M) + log(N) is the product rule. But log(M + N) has no simplification - it does not equal log(M) + log(N). For example, log(3 + 7) = log(10) = 1, but log(3) + log(7) = 0.4771 + 0.8451 = 1.3222. These are completely different. Logarithm rules apply to products and quotients, not to sums and differences inside the argument.
3. Writing log(M) / log(N) as log(M/N). The quotient rule says log(M/N) = log(M) - log(N), not log(M) / log(N). The change of base formula uses log(x) / log(b), but that is a ratio of two separate logarithms, not the log of a quotient. log(100) / log(10) = 2/1 = 2, which equals log_10(100) via change of base. log(100/10) = log(10) = 1. These are different calculations producing different results.
4. Forgetting that logarithms of negative numbers and zero are undefined. log(0) does not exist as a real number - as x approaches 0 from the positive side, log(x) approaches negative infinity but never reaches a finite value at x = 0. log(-5) does not exist in the real number system because no real power of 10 produces a negative number. If a logarithm calculation produces a negative or zero argument, the input values are outside the valid domain.
5. Misapplying the power rule to the base, not the argument. The power rule states log(M^n) = n x log(M). The exponent n must be on the argument M, not on the log itself. (log(M))^n is a completely different expression - it means "take the log of M, then raise the result to the nth power." For example, (log(10))^3 = 1^3 = 1. But log(10^3) = log(1000) = 3. These are different numbers with different meanings.
6. Assuming log(M x N) = log(M) x log(N). Multiplication distributes through addition, not through logarithm. The correct rule is log(M x N) = log(M) + log(N). If you multiply the logs instead of adding them: log(100) x log(1000) = 2 x 3 = 6, which is not the same as log(100 x 1000) = log(100,000) = 5. The confusion likely comes from mixing up the product rule for exponents (a^m x a^n = a^(m+n)) with the logarithm product rule, but they are analogous in opposite directions.
7. Not converting to a common base before applying log rules across terms. log_2(8) + log_3(9) cannot be simplified by the product rule because the bases are different. log_2(8) = 3 and log_3(9) = 2, so the sum is 5. But you cannot write this as log_?(8 x 9) = log_?(72) because there is no single consistent base. Logarithm rules only combine terms that share the same base.
Expert Tips
1. Memorize the common log values for powers of 2, 3, 5, and 7. log(2) = 0.3010. log(3) = 0.4771. log(5) = 0.6990. log(7) = 0.8451. With these four values, you can compute the log of any product or quotient of these numbers mentally using the product and quotient rules. log(6) = log(2) + log(3) = 0.7781. log(35) = log(5) + log(7) = 1.5441. log(15) = log(3) + log(5) = 1.1761. This covers a large fraction of real-world log calculations.
2. Use the power rule to solve any equation where the unknown is an exponent. The equation a^x = b always solves to x = log(b) / log(a) via the change of base formula. This is the single most important application of logarithms in applied mathematics - radioactive decay, bacterial growth, compound interest, and signal attenuation all require solving for an unknown exponent at some point.
3. For pH, decibels, and Richter scale problems, keep the formula structure in mind. pH = -log([H+]). Decibels = 10 x log(I/I_0). Richter magnitude = log(A/A_0). Each is a base-10 logarithm scaled and shifted to produce a human-friendly number. A difference of 1 unit on each scale represents a factor of 10 in the underlying physical quantity - a pH difference of 1 means a tenfold difference in hydrogen ion concentration, and a Richter magnitude difference of 1 means a tenfold difference in amplitude.
4. Verify logarithm results by exponentiating. If you compute log_5(200) = 3.2918, verify by computing 5^3.2918 and confirming it equals 200. If you compute ln(x) = 4.7, verify by computing e^4.7 = 110.0 and confirming x was 110. This inverse relationship check takes five seconds and catches every arithmetic error and mode mistake.
5. Use the natural log for anything involving continuous rates. Continuously compounded interest, instantaneous population growth rates, radioactive decay constants, and RC circuit time constants are all defined using natural logarithms because the mathematics of continuous change is built on base e. When a formula contains e^(kt) or e^(-kt), the natural log is the correct tool for solving for t or k - not the common log, even though common log gives the same answer via the change of base formula.
Frequently Asked Questions
What is the difference between log and ln?
Log (without a base specified) typically refers to the common logarithm with base 10: log(x) asks what power of 10 produces x. Ln refers to the natural logarithm with base e (approximately 2.71828): ln(x) asks what power of e produces x. The two are related by ln(x) = log(x) x 2.3026, where 2.3026 = ln(10). In pure mathematics, "log" often means natural log by convention. In engineering and applied science, "log" almost always means base 10. Always check the context.
Why is the logarithm of a number less than 1 always negative?
For base 10: log(0.1) = -1 because 10^(-1) = 0.1. Log(0.001) = -3 because 10^(-3) = 0.001. Any number between 0 and 1 requires a negative exponent to produce it from a base greater than 1. Since logarithms ask for the exponent, and the exponent must be negative to produce a fraction less than 1, the logarithm must be negative. The same logic applies to any base greater than 1.
Can you take the logarithm of a negative number?
Not in the real number system. No real power of 10 (or e, or any positive base) produces a negative result, because positive numbers raised to any real power remain positive. The logarithm of a negative number exists only in the complex number system, where ln(-1) = i x pi (using Euler's formula e^(i x pi) = -1). For all practical purposes in science, engineering, and finance, logarithm inputs must be strictly positive.
What is the antilogarithm?
The antilogarithm is the inverse operation of the logarithm - it recovers the original number from its logarithm. The antilog base 10 of y is 10^y. The antilog base e (antiln) of y is e^y. If log(x) = 2.6990, then x = 10^2.6990 = 500. If ln(x) = 3.4012, then x = e^3.4012 = 30.0. On a calculator, the antilog base 10 is typically the 10^x button, and the antiln is the e^x button.
How does the change of base formula work?
The change of base formula log_b(x) = log(x) / log(b) lets you compute a logarithm in any base using only the base-10 or natural log functions available on a standard calculator. For log base 6 of 216: log(216) / log(6) = 2.3345 / 0.7782 = 3.0000. Verify: 6^3 = 216. You can use either log or ln in both numerator and denominator - the ratio is the same because the ln(10) factor cancels: ln(216) / ln(6) = 5.3753 / 1.7918 = 3.0000.
What does it mean when a logarithm equals a negative number?
A negative logarithm means the argument is between 0 and 1 (for a base greater than 1). log(0.05) = -1.3010 means 10^(-1.3010) = 0.05. In pH terms, a high hydrogen ion concentration (very acidic solution) produces a low (even negative) pH because pH = -log([H+]) and high [H+] means log([H+]) is a large negative number, making pH a large positive number. The negative sign in the pH formula is there specifically to make pH positive for physically realistic acid concentrations.
Final Thoughts
Logarithms exist because the world contains quantities that vary over ranges too vast for linear scales to handle. From the hydrogen ion concentration in a solution to the intensity of an earthquake to the time it takes an investment to double, logarithms compress these ranges into numbers that human intuition can work with. The five rules - product, quotient, power, change of base, and inverse - all follow from the single definition of what a logarithm is, and the change of base formula means you never need more than the log or ln button to compute any logarithm in any base. Use the logarithm calculator step by step tool at CalcAdvisor.com to evaluate any logarithm and verify exponential equations - and use the rules and examples in this guide to understand exactly why the result is what it is.