Advertisement
728x90 Ad Space

Log Calculator (Logarithm)

Please provide any two values to calculate the third in the logarithm equation logbx = y. It can accept "e" as a base input.

log
base
( )  = 

Result

loge(100) 2
Expression e2 = 100
ln(100) 4.60517
log10(100) 2
log2(100) 6.64386
Advertisement
300x250 or 320x100 Ad Space
log-calculator overview

A Logarithm Is an Exponent

log-calculator 1

Ask "what power of 2 gives 8?" and the answer is 3. A logarithm is just that question written in symbols: log2(8) = 3. The base sits below the line, the argument sits in parentheses, and the value is the exponent that turns the base into the argument. If by = x, then y = logb(x), and the two statements carry exactly the same information.

by = x  ↔  y = logb(x)

Three conditions come with the definition. The base b must be positive and must not equal 1, and the argument x must be positive. The reasons are structural rather than arbitrary: a positive base raised to any real power is always positive, so a negative or zero argument has no real logarithm, and a base of 1 produces 1 for every exponent, which cannot be reversed. Those constraints matter later, when solving equations that appear to produce a second answer.

Because the logarithm undoes exponentiation, the two operations cancel each other in both directions: logb(bx) = x and blogb(x) = x. Plotted on the same axes, y = bx and y = logb(x) are mirror images across the line y = x. Everything else on this page, from the product rule to the shape of the graph, follows from that inverse relationship.

Notation is inconsistent across fields, which causes more confusion than the mathematics does. In school algebra, "log" without a subscript usually means base 10. In calculus and physics, it often means the natural logarithm. In computer science, it frequently means base 2. The ISO 80000-2 standard recommends writing the base explicitly as loga, reserving ln for base e, lg for base 10, and lb for base 2, but the convention never fully displaced local habits. When you see a bare "log" in someone else's work, check the context before assuming.

It is worth pausing on why anyone bothers. Before mechanical calculators, multiplying two eight-digit numbers by hand was slow and error-prone, while adding them was easy. Logarithms turn multiplication into addition, so a table of logarithms plus two additions replaces a long multiplication. That trick ran commerce, astronomy, and navigation for three centuries, and although machines now do the arithmetic, the underlying idea still governs how we measure sound, acidity, earthquake energy, and information.

Three Rules, One Derivation Each

log-calculator 2

The logarithm rules are not separate facts to memorize. Each one restates an exponent law. If you can write down bm · bn = bm+n, you have already proved the product rule.

Product rule

Let m = logb(x) and n = logb(y). Then x = bm and y = bn, so xy = bmbn = bm+n. Taking logb of both sides gives logb(xy) = m + n, which is the rule. The log of a product is the sum of the logs, and that is the whole reason logarithms were invented.

logb(x · y) = logb(x) + logb(y)

Example: log2(8 × 4) = 3 + 2 = 5, and indeed 25 = 32.

Quotient rule

The same argument with division: x/y = bm/bn = bm−n, so the log of a quotient is the difference of the logs. A useful special case is logb(1/y) = -logb(y), which follows by setting x = 1.

logb(x / y) = logb(x) - logb(y)

Example: log10(1000 / 10) = 3 - 1 = 2, and 102 = 100.

Power rule

Raising the argument to a power multiplies the logarithm: xk = (bm)k = bmk, so logb(xk) = k · logb(x). This is the rule that lets you pull a variable out of an exponent, which is how exponential equations get solved.

logb(xk) = k · logb(x)

Example: log2(45) = 5 × 2 = 10, and 210 = 1024.

Applied together, the rules expand or compress expressions. For instance, logb(x2y3 / z) becomes 2logb(x) + 3logb(y) - logb(z). The direction matters: expanding is useful when you want to isolate a variable, compressing is useful when you want a single logarithm to convert into exponential form.

One thing the rules do not say is that the log of a sum equals the sum of the logs. log(x + y) has no simpler form, and treating it as log x + log y is the most common algebraic error in the topic. Test it once with numbers and the mistake becomes memorable: log(8 + 8) = log 16 ≈ 1.204, while log 8 + log 8 ≈ 1.806.

Change of Base and Other Working Formulas

log-calculator 3

Change of base

Every scientific calculator has a base-10 key and a natural-log key, and almost none has a key for base 7. The change-of-base formula closes that gap. Starting from y = logb(x) and rewriting as by = x, take logk of both sides to get y · logk(b) = logk(x), then divide. The result expresses any base in terms of any other, and in practice you use k = 10 or k = e.

logb(x) = logk(x) / logk(b)

Example: log7(250) = ln(250) / ln(7) = 5.5215 / 1.9459 ≈ 2.8375

Reciprocal base

Swapping base and argument inverts the value. The identity follows from change of base with k = c, and it explains why log2(10) and log10(2) multiply to 1.

logb(c) = 1 / logc(b)

Example: log2(10) ≈ 3.3219, and 1 / 0.3010 ≈ 3.3219

Values that are always true

Four identities follow directly from the definition and are worth knowing by sight, because they let you check a result without a calculator. The last two are the inverse relationships restated.

logb(1) = 0

logb(b) = 1

logb(bk) = k

blogb(x) = x

logb(x) → -∞ as x → 0+

The limit is the reason a logarithm graph has a vertical asymptote at the y-axis rather than a lowest point. It also explains why "log of zero" is not a number: the function descends without bound as the argument approaches zero, and never reaches it.

When computing by hand, remember that a logarithm's integer part tells you the order of magnitude and the decimal part carries the digits. log10(4,200) = log10(4.2) + 3 ≈ 0.6232 + 3 = 3.6232. That split is exactly how printed log tables were used: the table supplied the decimal part, and you supplied the power of ten.

Reading the Calculator

log-calculator 4

The tool above solves logb(x) = y. It has three fields, and it needs any two of them. Leave the unknown blank and the calculator fills it in, which means the same tool handles "evaluate this log," "find the base," and "find the argument" without separate modes.

Evaluating a logarithm. Type the base and the argument. Base 10 with argument 1000 returns 3, because 103 = 1000. Base e with argument 100 returns about 4.605, since e4.605 ≈ 100. The base field accepts the letter e directly, so you do not need to type 2.71828.

Finding the base. If logb(64) = 3, enter 64 as the argument and 3 as the result. The calculator returns 4, because 43 = 64. This is the exponential form doing the work: b = x1/y.

Finding the argument. If log2(x) = 5, enter 2 as the base and 5 as the result, and the calculator returns 32. Here it is computing by directly.

Inputs outside the domain produce an error rather than a number, which is intentional. A negative or zero argument, a negative base, or a base of exactly 1 all fail the definition, and returning a complex value without saying so would be worse than refusing. If you need a logarithm of a negative number, you are working in complex analysis, where the logarithm becomes multi-valued and the simple real function no longer applies.

Base 10, Orders of Magnitude, and the Decibel

Base-10 logarithms earned the name "common" because they match the way we count and because they make scientific notation almost automatic. The integer part, called the characteristic, is the exponent in scientific notation, and the decimal part, the mantissa, is the log of the leading digits. That is why log(5,000,000) = log(5) + 6 ≈ 0.699 + 6 = 6.699: the 6 gives the magnitude, the 0.699 gives the digits.

Number log10 Number log10
1060.7782
20.301070.8451
30.477180.9031
40.602190.9542
50.6990101

The first column is the one worth memorizing. Knowing that log 2 is about 0.3 and log 3 is about 0.477 lets you estimate most other values and catch a wrong answer instantly. It also explains a familiar fact: doubling a quantity adds roughly 0.301 to its base-10 logarithm, so ten doublings multiply by about 1,024, which is where the approximation 210 ≈ 103 comes from.

Two everyday scales are base-10 logarithms in disguise, and both are commonly misstated. Sound power in decibels is L = 10 log10(P/P0), while sound pressure or voltage uses 20 log10(A/A0) because power scales with the square of amplitude. A 10 dB increase is ten times the power but roughly twice the perceived loudness; a 3 dB increase is about double the power. The reference pressure for airborne sound is 20 micropascals, and 140 dB corresponds to a power ratio of 1014 above the hearing threshold, not 1011.

pH is the negative base-10 logarithm of hydrogen ion activity: pH = -log10(aH+). A drop of one pH unit means ten times the activity, and pH 3 is a hundred times more acidic than pH 5. The scale is usually written as 0 to 14, but that range is a property of water at room temperature rather than a limit of the function; concentrated acids and bases fall outside it.

The Natural Logarithm and Continuous Growth

The number e, about 2.71828, is the value that continuous compounding approaches. If you compound 100% interest once you get 2, twice you get 2.25, monthly you get about 2.61, and as the number of compounding periods grows without bound the total approaches e. The natural logarithm is the inverse of that function, and it answers the question "how long does continuous growth at this rate take to reach this multiple?"

Its defining property is calculus. The derivative of ln(x) is 1/x, and the derivative of ex is ex, which is why the pair appears whenever a rate of change is proportional to the current amount. Radioactive decay, bacterial growth before resource limits bite, capacitor discharge, and cooling all follow that pattern. The integral of 1/x is ln|x| + C, which is another way of saying the natural logarithm is the area under the hyperbola.

d/dx ln(x) = 1/x

d/dx ex = ex

∫ (1/x) dx = ln|x| + C

logb(x) = ln(x) / ln(b)

Growth and decay problems reduce to one rearrangement. For continuous growth at rate k, a quantity doubles when ekt = 2, so t = ln(2)/k ≈ 0.693/k. At 7% continuous growth that is about 9.9 years; with annual compounding the exact answer is ln(2)/ln(1.07) ≈ 10.2 years, which the rule of 72 approximates as 10.3. The rule is a shortcut, not a law, and it drifts as the rate moves away from single digits.

ln(2) ≈ 0.6931 and ln(10) ≈ 2.3026 are the two constants that come up most often, and their ratio gives the conversion between natural and common logs: ln(x) = 2.3026 · log10(x). Euler's identity, eiπ + 1 = 0, ties the base to trigonometry and the complex plane, but for ordinary calculation the useful facts are the two constants and the derivative.

Base 2: Bits, Algorithms, and Octaves

Base-2 logarithms count doublings, which makes them the natural unit wherever information is stored or decisions are binary. To distinguish n equally likely possibilities you need enough yes/no questions to separate them, and that number is ceil(log2 n). A thousand values need 10 bits, because 29 = 512 is too few and 210 = 1024 is enough. A byte of 8 bits can therefore hold 256 distinct values, which is why old character sets stopped at 255.

In algorithm analysis, log2(n) appears whenever a process halves its remaining work. Binary search on a sorted array of a million items takes about 20 comparisons, because 220 ≈ 1.05 million. Merge sort runs in O(n log n), and the fast Fourier transform, which underpins audio compression, image processing, and much of modern communications, also runs in O(n log n). The logarithm is what makes those algorithms scale: doubling the input adds only one to the log factor.

Information theory uses base 2 because the bit is the unit of surprise. The entropy of a distribution is H = -∑ pi log2(pi) bits. A fair coin has 1 bit; a fair six-sided die has log2(6) ≈ 2.585 bits; a DNA base chosen uniformly has exactly 2 bits. That number is also the average number of binary questions needed to identify the outcome, which is why compression algorithms can approach it but not beat it on average.

Music uses the same base for a different reason. An octave is a doubling of frequency, so the interval between two pitches is log2(f2/f1) octaves. Twelve-tone equal temperament divides the octave into twelve equal ratios, each a factor of 21/12 ≈ 1.05946, and the cent, the standard unit for fine tuning, is defined as 1200 · log2(f2/f1). A semitone is exactly 100 cents by construction, which is why tuning software reports deviations in cents rather than hertz.

Logarithmic Scales in Measurement

Logarithmic scales exist because human senses and natural processes span ranges that linear axes cannot show. A factor of a trillion between the quietest sound and a jet engine, or between the weakest and brightest visible star, would flatten everything interesting into the first millimeter of a chart. Compressing the range with a logarithm keeps both ends visible.

Sound. The decibel is a ratio, not an absolute quantity, and the reference has to be stated. For sound pressure level the reference is 20 µPa, and the formula is 20 log10(p/p0). For sound power it is 10 log10(P/P0). The factor of 20 versus 10 is the single most common source of errors in audio work, and it follows from power being proportional to the square of pressure: squaring inside a logarithm becomes multiplying the log by 2. A quiet room sits near 30 dB, conversation near 60 dB, and a rock concert near 110 dB; each 10 dB step is ten times the power.

Earthquakes. The Richter scale, introduced in 1935 for California, is a base-10 logarithm of seismogram amplitude with a correction for distance. Each whole number is ten times the amplitude and about 31.6 times the radiated energy, so magnitude 7 releases roughly a thousand times the energy of magnitude 5. Modern seismology reports moment magnitude, Mw, which is calibrated to agree with Richter in the range where Richter works but does not saturate for very large events. Saying "Richter scale" for a magnitude 9 earthquake is a holdover, since Richter's original method was not designed for ruptures that size.

Chemistry. pH, pKa, and pKb are all negative base-10 logarithms, a convention that turns tiny concentrations into manageable numbers. The same device appears in pOH and in the Nernst equation, where a tenfold change in ion concentration shifts voltage by about 59 millivolts at room temperature.

Astronomy. The magnitude system is logarithmic and runs backwards: brighter objects have smaller numbers. A difference of five magnitudes is a factor of 100 in flux, so one magnitude is 1001/5 ≈ 2.512. Sirius, the brightest star, sits at about -1.46, while the faintest stars visible to the unaided eye are near magnitude 6. The system predates the telescope and was formalized before anyone knew what a star was, which is why the scale feels inverted.

Solving Equations That Contain Logs

Most logarithmic equations yield to one of three moves: convert to exponential form, use the one-to-one property, or compress the expression using the rules. The fourth step, checking the answers against the domain, is the one students skip and the one that decides whether the answer is correct.

Convert to exponential form. An isolated logarithm is the easiest case. From log3(x) = 4, rewrite as x = 34 = 81. From logb(64) = 3, rewrite as b3 = 64 and take a cube root: b = 4.

Use the one-to-one property. If logb(x) = logb(y), then x = y, provided both arguments are in the domain. So log2(x + 1) = log2(7) gives x = 6 immediately. This works only when the bases match; if they do not, change one of them first.

Compress, then exponentiate. Combine sums and differences into a single logarithm, then convert. For log2(x) + log2(x - 2) = 3, the product rule gives log2(x(x - 2)) = 3, so x(x - 2) = 8 and x2 - 2x - 8 = 0. That factors as (x - 4)(x + 2) = 0, offering 4 and -2; the negative root is discarded because log2(-2) is undefined. The answer is 4.

Check every candidate. Extraneous solutions appear whenever a step enlarges the domain, which happens when you apply the power rule carelessly, multiply both sides by an expression, or square. A candidate that makes any argument zero or negative is not a solution, no matter how cleanly it satisfied the transformed equation. Substituting back into the original line is the only reliable test.

Equations with logarithms on both sides and different bases are usually solved by graphing or by converting everything to a common base and isolating the variable. The calculator above handles the arithmetic once you have reduced the problem to logb(x) = y; it will not do the algebra for you, and it will reject an input that violates the domain rather than quietly returning a complex number.

How Logarithms Were Invented

John Napier, a Scottish landowner and mathematician, published Mirifici Logarithmorum Canonis Descriptio in 1614, introducing the idea of matching a geometric progression to an arithmetic one so that multiplication could be performed by addition. Napier was not writing a modern logarithm: his construction was based on a moving point and a line segment, and his "logarithm" of a number was a length, not an exponent. The conceptual cleanup came later.

Napier's motivation was practical. Astronomy in the late sixteenth century required multiplying and dividing long strings of trigonometric values, and the work was slow enough that a single error could ruin a night's observations. A table that converted those products into sums saved hours. Johannes Kepler used logarithms heavily in his calculations of planetary orbits, and the technique spread through navigation, surveying, and commerce within a generation.

Independently, the Swiss clockmaker Joost Bürgi constructed a similar table, published in 1620, though his work appeared after Napier's and never received the same credit. Henry Briggs, an English mathematician, visited Napier and proposed reworking the system around base 10, which produced the common logarithms that dominated calculation for the next three centuries. Briggs published his first tables in 1617 and a fuller set in 1624, and the base-10 choice is why "log" without a subscript came to mean base 10 in school mathematics.

William Oughtred turned the idea into a physical instrument in 1622 with the slide rule, aligning logarithmic scales so that lengths could be added and read off as products. The device survived into the 1970s, when it was displaced by the electronic calculator. The letter e for the natural base arrived through Leonhard Euler's work in the 1720s and 1730s, and the modern notation logb with a subscript base became standard much later still.

The historical arc is worth noting because it inverts the way the topic is usually taught. Logarithms were invented as a computational shortcut, and the inverse relationship with exponentials was recognized afterward. The shortcut is gone, but the inverse relationship turned out to be the more important discovery, since it describes growth, decay, and perception across every quantitative science.

Where Logarithms Show Up in Practice

Finance. Logarithmic returns, defined as ln(Pt/Pt-1), add across time, which linear percentage returns do not. That property makes them the standard input for volatility models and portfolio analysis. Continuous compounding uses A = Pert, and solving for time requires a natural logarithm: t = ln(A/P)/r. The rule of 72 is a mental approximation to the same calculation.

Data visualization. A logarithmic axis turns exponential growth into a straight line and keeps small values visible alongside large ones. Epidemic curves are often plotted this way so that the early phase and the peak can be compared, and stock charts use log axes when the time span covers more than a few doublings. The tradeoff is that equal vertical distances no longer represent equal absolute changes, which is why log axes need to be labeled explicitly.

Software and data. Complexity classes, database index depths, and the height of balanced trees are all logarithmic. Compression encoders assign shorter codes to more probable symbols using log2 probabilities, and hash tables grow their bucket arrays by doubling so that the average chain length stays near constant. Benford's law, which predicts that leading digits follow log10(1 + 1/d), is used in forensic accounting precisely because naturally occurring financial data tends to obey it while fabricated numbers often do not.

Perception. Fechner's law proposed that perceived intensity grows with the logarithm of stimulus intensity, which fits loudness and brightness reasonably well over moderate ranges. Modern psychophysics more often uses Stevens' power law, S = kIa, because the exponent varies by modality and the log relationship is a special case rather than a universal rule. The practical point survives either way: equal ratios of stimulus produce roughly equal steps of sensation, which is why decibels and magnitudes feel linear to us.

Biology and medicine. Bacterial growth in an unrestricted medium is exponential until nutrients or waste products intervene, and plotting log(cell count) against time gives a straight line whose slope is the growth rate. Half-lives of drugs and isotopes come from ln(2)/k. Blood pH is held within a few hundredths of a unit by buffering systems, and because the scale is logarithmic, that narrow range corresponds to a tightly controlled hydrogen ion concentration. Pharmacokinetic models routinely work in log space for the same reason finance does: multiplicative processes become additive.

The Shape of a Logarithmic Curve

For any valid base, the graph of y = logb(x) passes through (1, 0), because any base raised to the zero power is 1, and through (b, 1). It is defined only for positive x, approaches negative infinity as x approaches zero from the right, and increases without bound as x grows. The y-axis is a vertical asymptote, and the curve never touches it.

The growth is slow in a very specific sense: log(x) grows more slowly than xp for every positive p, no matter how small. log10 of a million is 6; log10 of a billion is 9. That is why a chart with a log axis can display a range of ten orders of magnitude without losing the small values, and why halving the distance to a target in a search takes only one more step rather than many.

Concavity depends on the base. For b > 1 the curve is concave down and increasing; for 0 < b < 1 it is concave up and decreasing, which is the same curve reflected across the x-axis. The derivative is 1/(x ln b), positive for b > 1 and shrinking as x grows, so the slope flattens continuously without ever reaching zero.

Transformations follow the rules. Adding a constant inside the argument shifts the graph horizontally, multiplying the argument by a constant shifts it vertically, and a coefficient outside scales it. Because logb(kx) = logb(k) + logb(x), a horizontal stretch is indistinguishable from a vertical shift on a log plot, which is why log-log and semi-log graphs turn whole families of functions into straight lines.

That linearization is the practical reason these plots are everywhere in science. If y = aekx, then ln y = ln a + kx, a straight line with slope k on a semi-log plot. If y = axk, then log y = log a + k log x, a straight line with slope k on a log-log plot. Fitting the line and reading the slope is often easier, and more diagnostic, than fitting the original curve, because a departure from straightness tells you immediately that the model is wrong.

What to Remember

A logarithm is an exponent, and every rule about logarithms is an exponent law rewritten. The product rule turns multiplication into addition, the power rule pulls exponents down where they can be solved for, and the change-of-base formula makes any base computable with the two keys on a scientific calculator. The domain restrictions are not decoration: positive arguments, positive bases, and no base of 1.

The calculator accepts any two of base, argument, and result, so it evaluates logarithms, recovers a base, and solves for an argument without switching modes. Natural logs use base e, common logs use base 10, and binary logs use base 2; the same identities apply to all of them, which is why the choice of base is usually a matter of convenience rather than mathematics.

For reference values and formal definitions, the NIST Digital Library of Mathematical Functions treats the elementary functions rigorously, and the ISO 80000-2 standard specifies the notations loga, ln, lg, and lb. If you want to keep practicing, our exponent calculator handles the inverse operation, and the scientific calculator covers the surrounding arithmetic.

Frequently Asked Questions

What is a logarithm?

A logarithm is the exponent you need. If by = x, then logb(x) = y, so log2(8) = 3 because 23 = 8. It is the inverse operation to exponentiation.

What does "log" mean without a base?

It depends on the field. In school mathematics it usually means base 10, in calculus and physics it often means the natural logarithm, and in computer science it frequently means base 2. ISO 80000-2 recommends writing the base explicitly.

What is e, and why is the natural log special?

e is about 2.71828, the limit of continuous compounding. The natural logarithm is its inverse, and its derivative is 1/x, which is why it appears wherever a rate of change is proportional to the current amount.

Can the base be any number?

Any positive number other than 1. A base of 1 cannot be inverted because 1 raised to any power is 1, and a negative base does not produce a real-valued function for all exponents.

Why is base 10 used so often?

It matches decimal notation, so the integer part of a base-10 log gives the order of magnitude directly. It also underlies pH, decibels for power ratios, and the older Richter scale.

What is the difference between log and ln?

ln is the logarithm with base e. "log" is ambiguous and depends on context, usually base 10 in school work and base 2 in computer science. The rules are identical; only the base changes.

How do I calculate a log with an unusual base?

Use change of base: logb(x) = ln(x)/ln(b), or the same ratio with base-10 logs. For example, log7(250) = ln 250 / ln 7 ≈ 2.8375.

What are the main logarithm rules?

log(xy) = log x + log y, log(x/y) = log x - log y, and log(xk) = k log x, all for a fixed valid base. There is no rule for log(x + y); it cannot be simplified.

Can the argument be negative or zero?

Not in real numbers. The logarithm is defined only for positive arguments, and it tends to negative infinity as the argument approaches zero. Negative arguments require complex analysis.

Where are logarithms used in real life?

Sound levels, earthquake magnitude, pH, star brightness, compound interest and doubling time, algorithm complexity, data compression, and any chart that has to show values spanning many orders of magnitude.

Advertisement
970x250 or 728x90 Ad Space