CCalcNest AI

Logarithm Calculator

Natural, base-10, and custom base logarithms.

Enter values above — results appear instantly as you type.
AI Insight: Logarithms turn multiplication into addition: log(a×b) = log(a) + log(b). This is why log scales are useful for very large dynamic ranges (sound, earthquakes, pH).
Notice: This calculator is provided for educational reference. Results depend entirely on the values you enter, and you should verify any figure used for academic, professional, or safety-critical purposes. See our full disclaimer.
Written with AI assistance and checked by automated validation · Last updated: August 2026 · How we build and check this · Methodology
Looking for a different calculator? Try our AI Finder — describe what you need in plain English. Try AI Finder →

Formula

log_b(x) = ln(x)/ln(b)

Example

ln(100)≈4.605; log₁₀(100)=2.

Embed this calculator on your site

Add this free calculator to your own website with one line of code. The embedded version is responsive, ad-free, and includes a small attribution link back to CalcNest AI.

<iframe src="https://calcnestai.com/embed/logarithm-calculator.html" width="100%" height="700" frameborder="0" style="border: 1px solid #e5e5e5; border-radius: 12px; max-width: 720px;" loading="lazy" title="Logarithm Calculator — Free Tool by CalcNest AI"></iframe>

Understanding the Logarithm Calculator

A logarithm calculator returns the natural log, base-10 log, and a log in any base you choose. A logarithm answers what exponent produces a given number, which makes it the inverse of exponentiation and the tool for turning multiplication into addition.

How it actually works

Enter a positive number and a base. The calculator computes the natural and base-10 logs directly and derives the custom base using the change of base formula. One hundred gives ln of 4.605, log base 10 of exactly 2, and log base 2 of 6.644.

The three common bases
BaseNotationUsed for
e ≈ 2.71828lnCalculus, growth, decay
10log or log₁₀Engineering, decibels, pH
2log₂ or lbComputing, information theory
Anylog_bChange of base converts freely

The deeper context most people miss

All logarithms differ only by a constant factor, since log base b of x equals ln x divided by ln b. That means the choice of base is a matter of convenience rather than substance, and it is why a graph on a log scale looks the same shape regardless of which base labelled the axis.

Why logarithms were invented and why they still matter

Napier published his work on logarithms in 1614 to solve a practical problem: multiplication and division of large numbers by hand were slow and error-prone, particularly in astronomy and navigation. Logarithms convert multiplication into addition, since log of a product equals the sum of the logs, so multiplying two numbers becomes looking up two logarithms, adding them, and looking up the result in reverse. Tables of logarithms and later the slide rule, which is a physical implementation of the same principle, remained the standard computational tools for over three centuries until electronic calculators displaced them in the 1970s. Laplace remarked that logarithms doubled the working life of an astronomer. That original purpose is obsolete and the mathematics is not, because the properties that made them useful for computation make them essential in analysis. The natural logarithm arises as the integral of one over x and as the inverse of the exponential function, which is the unique function equal to its own derivative, and this is why e appears throughout calculus rather than being an arbitrary constant. Logarithmic differentiation simplifies products and powers. Log transformations turn multiplicative relationships into linear ones, which is why regression on logged variables estimates elasticities and why power laws appear as straight lines on log-log plots.

A worked example: why log scales are everywhere

Log base 10 of 100 being exactly 2 illustrates the compression that makes log scales useful: each unit step represents a tenfold change, so a scale can span many orders of magnitude in a readable range. Several familiar measurements are logarithmic for this reason. The Richter and moment magnitude scales for earthquakes are base 10 in amplitude, so a magnitude 7 has ten times the amplitude of a 6 and roughly 32 times the energy, which is why the public perception that a 7 is slightly worse than a 6 is badly wrong. Decibels are logarithmic, with 10 dB representing a tenfold power ratio, which matches how hearing perceives loudness and is why a 3 dB increase doubles power while sounding only slightly louder. The pH scale is the negative log of hydrogen ion concentration, so pH 4 is ten times more acidic than pH 5. Stellar magnitude is logarithmic and inverted. Musical pitch is logarithmic in frequency, with each octave doubling. In each case the underlying reason is the same: human perception of many quantities is approximately logarithmic, following the Weber-Fechner relationship, so a logarithmic scale matches perception. It also means that intuition about differences on these scales is systematically wrong unless the compression is kept in mind.

Deciding when to use a log scale in a chart

Log scales are the right choice in specific circumstances and misleading in others. Use one when data spans several orders of magnitude, since a linear scale compresses everything small into an unreadable band near the axis. Use one when the interesting feature is proportional change rather than absolute change, since equal distances on a log axis represent equal ratios, which makes a doubling look the same whether from 10 to 20 or from 1,000 to 2,000. Use one for data expected to follow exponential growth, since exponential growth appears as a straight line and departures from it become visible, which was widely used during the early phase of the COVID-19 pandemic and generated considerable public confusion in the process. Use log-log axes for suspected power laws, which also linearise. Against that, log scales mislead casual readers who read distance as magnitude, which is a genuine communication problem rather than a failure of the audience, and any log-scaled chart aimed at a general readership needs labelling that makes the compression explicit. Zero and negative values cannot be plotted, which is a hard constraint. Differences that look small can be enormous. The honest approach is to choose the scale for the question being asked and to state which is being used, and to consider showing both where the audience is mixed.

Logarithms in information and complexity

Base 2 logarithms count binary decisions, which is why they dominate computing. Information content of an event with probability p is minus log base 2 of p, measured in bits, and Shannon entropy is the expected value of that across a distribution, giving the theoretical minimum average bits needed to encode messages from a source. That result founded information theory in 1948 and sets hard limits on compression: no lossless scheme can beat the entropy of the source, which is why compressing already-compressed data achieves nothing. In algorithm analysis, logarithms appear wherever a problem is repeatedly halved, so binary search runs in log n comparisons and balanced tree operations in log n time, and the practical significance is enormous: searching a billion sorted items takes about 30 comparisons rather than a billion. Sorting by comparison requires at least n log n comparisons, a lower bound derived from the log of the number of possible orderings. Logarithms measure the number of digits needed to write a number, which connects to storage requirements. In cryptography, the discrete logarithm problem, finding the exponent given the result in modular arithmetic, is believed hard and underpins Diffie-Hellman key exchange and elliptic curve cryptography, so the difficulty of inverting exponentiation in that setting is what secures a large share of internet traffic.

Variations: change of base, log rules, and computation

The change of base formula converts any logarithm to any other by dividing, which is why calculators need only natural and base-10 logs. The core identities are that the log of a product is the sum of logs, the log of a quotient is the difference, and the log of a power brings the exponent down as a multiplier, and these three follow directly from the corresponding exponent rules. Logarithms of one are always zero and of the base always one. Negative and zero arguments have no real logarithm, since no real exponent produces them, and complex logarithms exist and are multivalued, requiring a branch choice. Common notational confusion exists, since log without a subscript means base 10 in engineering, base e in much of mathematics, and base 2 in some computing contexts, so checking the convention matters. In computation, log1p and expm1 functions exist to preserve accuracy for arguments near zero where the naive computation loses precision catastrophically. Log-sum-exp is a standard technique in statistical computing to avoid underflow when working with products of small probabilities, and it is used throughout machine learning for exactly that reason.

Working with logarithms

Use the change of base formula to compute any base from natural or base-10 logs, dividing log of the number by log of the base. Check which convention an unsubscripted log follows, since it means base 10 in engineering, base e in mathematics, and base 2 in some computing contexts. Remember that log scales compress by orders of magnitude, so a step of one on the Richter scale is tenfold in amplitude and a step on pH is tenfold in concentration. Use a log scale when data spans several orders of magnitude or when proportional change is the point, and label it explicitly since readers interpret distance as magnitude. Note that zero and negative values cannot appear on a log axis, which is a hard constraint on the chart type. Use the product, quotient, and power rules to simplify before computing, which is what made logarithms a computational tool historically. Use log1p and expm1 near zero, where naive computation loses precision badly. And work in logs when multiplying many small probabilities, which prevents underflow.

What people get wrong

  • Reading a one-unit step on a logarithmic scale as a small change, when it represents a tenfold difference on Richter, pH, and decibel scales.
  • Assuming an unsubscripted log means base 10, when it means base e throughout much of mathematics and base 2 in parts of computing.
  • Presenting a log-scaled chart to a general audience without explicit labelling, since readers naturally interpret distance as absolute magnitude.
  • Multiplying many small probabilities directly, which underflows to zero, rather than summing their logarithms and exponentiating at the end.

Where the math comes from

log_b(x) answers what exponent applied to b produces x. The change of base formula gives log_b(x) = ln(x) / ln(b), so any base derives from any other by a constant factor. The core identities follow from exponent rules: log(ab) = log a + log b, log(a/b) = log a − log b, and log(aⁿ) = n log a.

Questions and answers

What is the difference between percent and percentage point?

Percent change is relative (going from 5% to 10% is a 100% increase). Percentage point change is absolute (the same shift is a 5 percentage point increase). News stories often confuse these.

How do I calculate a discount?

Discount amount = original x discount %. Final price = original x (1 - discount %). For 20% off $100: discount $20, final $80.

What is the formula for compound percentage?

Final = original x (1 + r1) x (1 + r2) x ... where each r is a percentage as decimal. A 10% raise then 10% cut: 1.10 x 0.90 = 0.99 = 99% of original.

How do I reverse a percentage?

If $80 is 80% of original: original = $80 / 0.80 = $100. To reverse 'X% off' to find original: original = final / (1 - X/100).

How do percentages work in tax?

Marginal tax rate applies to income within a bracket. Effective rate is total tax / total income. They diverge because of progressive brackets.

What does a logarithm actually tell me?

What exponent produces a given number. Log base 10 of 100 is 2 because 10 squared is 100. It's the inverse of exponentiation, which is why it converts multiplication into addition and was invented as a computational shortcut in 1614.

Does the base matter?

Only for convenience. All logarithms differ by a constant factor through the change of base formula, so a log-scaled graph has the same shape regardless of base. Base e suits calculus, base 10 suits engineering scales, and base 2 suits computing.

What does log mean without a subscript?

It depends on the field: base 10 in engineering and most calculators, base e in much of pure mathematics, and base 2 in some computing contexts. Checking the convention matters, since the values differ by a factor of over three between base 2 and base 10.

Why are earthquake and sound scales logarithmic?

Because they span many orders of magnitude and because human perception of intensity is approximately logarithmic. A magnitude 7 earthquake has ten times the amplitude of a 6 and roughly 32 times the energy, which the linear-sounding numbers conceal.

When should I use a log scale on a chart?

When data spans several orders of magnitude, when proportional change is the point, or when testing for exponential growth, which appears as a straight line. Label it clearly, since readers naturally interpret distance as absolute magnitude.

Why can't I take the log of zero or a negative number?

Because no real exponent applied to a positive base produces zero or a negative result. The logarithm approaches negative infinity as the argument approaches zero. Complex logarithms of negative numbers exist and are multivalued, requiring a branch choice.

Where do logarithms appear in computing?

Wherever a problem halves repeatedly: binary search takes log n comparisons, so searching a billion sorted items needs about 30. Comparison sorting requires at least n log n. And Shannon entropy in bits uses base 2 logs to set the limit on lossless compression.

Related calculators

Polar to Cartesian · Weighted Average · Average · Degrees Radians · Normal Distribution