Logarithm Calculator
Logarithms for any base.
What is the Logarithm Calculator?
A logarithm answers how many times a base must be multiplied by itself to reach a given value (x). That is, log_b(x) = y means b^y = x. This tool supports common log (base 10), natural log (ln, base e), binary log (base 2), and any custom base.
How to use it
Enter a positive value for x, choose a base preset (10, e, 2) or type a custom base, then press Calculate. x must be greater than 0, and the base must be greater than 0 and not equal to 1.
Formula & reference
Change-of-base formula: log_b(x) = ln(x) / ln(b). Base 10 is the common log, base e (≈2.71828) is the natural log (ln), and base 2 is the binary log.
| Expression | Result |
|---|---|
| log₁₀(100) | 2 |
| ln(e) | 1 |
| log₂(8) | 3 |
Why decibels, earthquake magnitude, and pH use a log scale
A decibel (dB) is defined as 10log₁₀(intensity ratio), so a 10x jump in sound intensity raises the level by exactly 10dB. A 100x jump gives 10log₁₀(100)=20dB, and a 1000x jump gives 10log₁₀(1000)=30dB — intensity grows exponentially while the decibel number grows in tidy, linear steps. Since audible sound intensity spans a range of trillions, dropping the log would make the raw numbers unmanageably large.
Earthquake magnitude works the same way: each whole step up in magnitude corresponds to roughly a 10x increase in ground amplitude. Magnitude 5 and magnitude 6 differ by only 1 on paper, but the actual shaking differs by a factor of 10. pH follows the identical pattern, defined as pH = −log₁₀([H⁺]); going from pH 4 to pH 7 (a difference of 3) means the hydrogen-ion concentration drops by 10³=1000x (check: −log₁₀(0.0001)=4). Without recognizing that "1 unit difference = 10x difference" on a log scale, it's easy to underestimate what a small change in decibels or magnitude actually means.
Choosing between log₂, log₁₀, and ln
Each base suits a different purpose. log₁₀ (common log) is intuitive for values that grow "by powers of 10," like digit counts, decibels, or pH. log₂ (binary log) fits processes that repeatedly halve, such as counting binary-search comparisons in a data structure (e.g. log₂(1024)=10 means finding one item among 1024 takes at most 10 comparisons). ln (natural log, base e) pairs most naturally with calculus for continuous-growth models — compound interest, population growth, radioactive decay — where the instantaneous rate of change is proportional to the current value. This calculator lets you switch between all three presets with one button, so you can compare them directly for your situation.