Skip to main content

Log Calculator - log, ln, log10, and Any Base

Free online tool to compute log10, ln, log2, and logarithms of any base with the change-of-base formula. Default example: log10(1000) = 3. Runs in your browser.

Input Values

The result uses log_b(x) = ln(x)/ln(b). An inverse check b^result ≈ x is shown so you can see IEEE rounding.

Converted Result

Logarithm will appear here

What Is a Log Calculator and Why Do You Need One?

A log calculator evaluates logarithms: the exponent you put on a base b to recover a positive number x. In symbols, y = log_b(x) means b^y = x. People search for how to calculate logarithms, the difference between ln and log, the log of 1, and the change of base formula because those four facts are what homework, pH, decibels, and half-life problems actually use.

A logarithm is not a button unique to one brand of calculator. It is the inverse of a power, so every log problem is secretly an exponent problem written backwards. If you can say which power of 10 makes 1000, you already know log10(1000) = 3. If you can say which power of e makes 1, you already know ln(1) = 0. The rest of this page is that same question with a labeled base, a printed change-of-base step, and an inverse check so IEEE rounding cannot hide a wrong mode.

There is not one logarithm. ln is the natural log, base e ≈ 2.71828, and it is the one calculus uses because the derivative of ln x is 1/x. log10 (common log) is the one chemistry and many high-school textbooks mean by “log.” log2 is the one computer science means when it counts bits. Writing “log” without a base is how students lose points; this page labels the mode.

This free online log calculator runs in your browser. Nothing is uploaded. x must be positive. A custom base must be positive and not 1. The numeric value uses the platform functions Math.log, Math.log10, and Math.log2 when those match the mode, and always shows the identity log_b(x) = ln(x)/ln(b) so you can check a homework step. It also shows the inverse check b^result ≈ x, which will be close to x but not always bit-identical, because IEEE floats are not exact reals.

Logs invert powers, so the sibling exponent calculator is the other half of the same identity. Half-life and exponential decay problems need both: A = A0 e^(−kt) is an exponent; solving for t is a log. Use the half-life calculator when the context is radioactive decay rather than a bare logarithm. A scientific calculator is the broader tool if you also need trig on the same sheet.

How to Use This Free Online Log Calculator

Using this logarithm calculator is straightforward:

  1. Choose the log type. log10 is the common log. ln is the natural log. log2 is the binary log. Custom base asks for b as well as x.
  2. Enter x (and b if the mode is custom). x must be greater than 0. b must be greater than 0 and not equal to 1. Decimals and E-notation are allowed.
  3. Read the change-of-base step ln(x)/ln(b) and the inverse check b^result ≈ x. If the inverse is slightly off x, that is rounding, not a different logarithm.
  4. Copy the value, or clear the fields. The last inputs are saved locally for up to 30 days.

Note: log of a negative number and log of zero are not real; they are rejected instead of returning NaN or −Infinity. This is IEEE float, not a symbolic CAS. ln of a number extremely close to 1 can underflow the interesting digits. Very large x can overflow the inverse check even when the log itself is finite.

Logarithm Formula - Change of Base and Worked Examples

logb(x) = ln(x) / ln(b)
Defined for x > 0, b > 0, b ≠ 1

The change-of-base formula is how every calculator that only exposes ln still computes log10 and log2. You can also write log_b(x) = log10(x)/log10(b). Both are identities, not approximations, until floating-point rounding appears.

Example - log10(1000) (the default):

  • 10^3 = 1000, so log10(1000) = 3
  • ln(1000)/ln(10) ≈ 6.907755 / 2.302585 = 3
  • Inverse: 10^3 = 1000, which matches x

Example - ln(e) and log of 1:

  • ln(e) = 1 because e^1 = e
  • log_b(1) = 0 for every valid b, because b^0 = 1
  • ln(1) = 0, log10(1) = 0, log2(1) = 0

Example - custom base log2(8):

  • 2^3 = 8, so log2(8) = 3
  • Change of base: ln(8)/ln(2) ≈ 2.07944 / 0.693147 = 3
  • Inverse: 2^3 = 8. If you instead wanted 8^2, that is a power, not a log - use the exponent calculator.

ln vs log10 vs log2 - Which Log Should You Use?

NameBaselog(1000) styleTypical use
lne ≈ 2.71828ln(1000) ≈ 6.907Calculus, continuous growth
log1010log10(1000) = 3pH, decibels, “log” in chem
log22log2(1024) = 10Bits, binary trees

They differ only by a constant factor: ln(x) = log10(x) × ln(10), and log2(x) = ln(x)/ln(2). Picking the wrong one is not a rounding error; it is a different function. If a chemistry lab says “log,” it almost always means log10. If a proofs course says “log,” check the base once.

Where Logarithms Show Up in Real Work

1. pH and concentration

pH = −log10([H+]). A hydrogen-ion concentration of 1e−3 M has pH 3. That is a common log, not ln. This calculator will give log10(0.001) = −3; it will not convert units or activity coefficients.

2. Half-life and exponential decay

A = A0 e^(−kt) rearranges to t = −ln(A/A0)/k. The logarithm is ln because the model used base e. If your data is half-lives of a nuclide, the dedicated half-life calculator packages the same identity with the right labels.

3. Information and bits

log2(n) is how many bits you need to distinguish n equally likely symbols. log2(256) = 8, which is why a byte holds 256 values. That is exact here; entropy of a non-uniform source is a weighted sum of logs, which this page does not compute.

4. What this tool will not do

It will not take log of a negative or of zero. It will not return complex logs. It will not solve log equations symbolically (no “solve for x in 2 log(x) = 5”). It will not apply log(a+b) = log a + log b, because that identity is false - the real product rule is log(ab) = log a + log b.

Related Mistakes When Calculating Logarithms

Mixing ln and log10 is the usual error: ln(1000) is about 6.91, not 3. Using log(a+b) = log a + log b is next; that would say log(2+2) = 2 log 2, which claims log 4 = log 4 only by accident of the numbers you picked, and fails for 1+1. Change of base inverted - ln(b)/ln(x) instead of ln(x)/ln(b) - produces the reciprocal of the answer.

Log of a negative is not “just undefined on the calculator.” It is undefined in the reals. Log of 0 is an infinite singularity, not a large finite number this page will invent. Log of 1 really is 0; if a spreadsheet shows a tiny nonzero residue, that is formatting of 0, not a different theorem.

Bases in (0, 1) are legal. log_0.5(8) = −3 because (1/2) ^(−3) = 8. Base 1 is not legal: 1^y is 1 for every y, so it cannot hit x ≠ 1 and it hits x = 1 for every y.

Logarithm Identities That Are True (and Ones That Are Not)

The product rule log_b(xy) = log_b(x) + log_b(y) is true for positive x, y. The quotient rule log_b(x/y) = log_b(x) − log_b(y) is true. The power rule log_b(x^k) = k log_b(x) is true when x^k stays positive. Change of base log_b(x) = ln(x)/ln(b) is true, and this calculator prints that fraction every time. Inverse: b^(log_b(x)) = x, which is the check in the result panel.

False identities cause most of the search traffic. log(a+b) is not log a + log b. log(a−b) is not log a − log b. log(1/x) is −log x, which is true, but log(−x) is not −log x when x is positive - log of a negative is not real. ln(e^x) = x for real x, but e^(ln x) requires x > 0. log_b(b) = 1. log_b(1) = 0. Those last two are the fastest sanity checks you can run after you switch modes.

Custom bases in (0, 1) reverse inequalities: log_0.5(8) = −3 because you need a negative exponent to grow a fraction into 8. Bases below 0 are rejected along with base 1. If you wanted 8^2 instead of log_2(8), that is an exponent, not a logarithm - switch to the exponent calculator.

Inverse Check b^result ≈ x - What Rounding Does

After computing y = log_b(x), the tool evaluates b^y and prints it next to x. For log10(1000) you should see 3 and an inverse of 1000. For ln(2) you should see about 0.693147 and an inverse very close to 2, not always the exact binary of 2, because exp(ln(2)) in binary64 is a rounded reconstruction. That gap is a format limit, not a wrong formula. If the inverse is wildly different from x, the mode or the base is wrong.

Change of base always uses natural logs in the printed step even when the value used Math.log10 or Math.log2. Those platform functions are more accurate for their own bases; showing ln(x)/ln(b) keeps the homework identity visible. For log2(1024) both paths give 10. For awkward x such as 3, log2(3) is irrational and the inverse check will be extremely close to 3 rather than a terminating decimal.

Decay problems that look like “log” in a lab manual are often ln because the model is e^(−kt). Pair this page with the half-life calculator when t is the unknown. For a full expression line with trig, use a scientific calculator. This page will not solve for x inside a log equation, will not take log of a negative, and will not upload x. The usual search queries - how to calculate logarithms, difference between ln and log, log of 1, change of base formula, log of a negative, and whether the numbers leave the browser - are answered in the FAQ with the same wording as the structured data. ln(e) = 1, log10(1000) = 3, and log2(8) = 3 are the three mental checks worth running after you switch modes. If those fail, the mode is wrong; if they pass and a messier x looks slightly inexact on the inverse line, that is IEEE rounding, not a different logarithm. Privacy is not a slogan here: x never leaves the tab. After the first load, ln(1) is still 0 if the wifi drops. That is the entire product: labeled bases, change of base on screen, an inverse check, and no upload.

Frequently Asked Questions (FAQ) - Log Calculator

How do I calculate logarithms?

log_b(x) is the exponent you put on b to get x. This calculator uses the change-of-base formula log_b(x) = ln(x)/ln(b). Pick log10, ln, log2, or a custom base, enter a positive x, and read the value plus the inverse check b^result ≈ x.

What is the difference between ln and log?

ln is the natural logarithm, base e ≈ 2.71828. In science, log often means log10 (common log). In computer science, log often means log2. This tool labels each mode so you do not have to guess which base a textbook meant.

What is the log of 1?

log_b(1) = 0 for every valid base b, because b^0 = 1. ln(1) = 0, log10(1) = 0, and log2(1) = 0.

What is the change of base formula?

log_b(x) = ln(x)/ln(b) = log10(x)/log10(b). Any positive base (except 1) can be rewritten using natural logs or common logs. This calculator always shows ln(x)/ln(b) so you can check a homework step.

Can you take the log of a negative number?

Not in the real numbers. log_b(x) is defined only for x > 0. The log of zero is also undefined (it diverges to −∞). This calculator rejects non-positive x instead of returning NaN.

Does this calculator upload my numbers?

No. Logarithms run in your browser with JavaScript. Nothing is sent to a server. After the page loads, the tool still works if the network drops.

Why Choose Our Log Calculator?

  • Free, no account. Unlimited logarithms.
  • Private. All math stays in the browser.
  • log10, ln, log2, and any base in labeled modes.
  • Shows ln(x)/ln(b) so change-of-base homework is checkable.
  • Inverse check b^result ≈ x for a sanity test.
  • Rejects log of 0 or negatives instead of NaN.
  • Works offline after the first page load.