Logarithm Calculator
Free log calculator that finds the logarithm of any number in any base using the change-of-base rule, and shows the natural log, log base 10 and log base 2.
Updated 2026-06-09 · Free · No sign-up · Runs privately in your browser
What is a logarithm calculator?
A logarithm calculator finds the exponent a base must be raised to in order to produce a given number. Enter a positive number x and a base b, press Calculate, and this tool returns log_b(x) along with three common companions: the natural log (base e), the log base 10, and the log base 2. In short, it answers the question “to what power must I raise b to get x?”
A logarithm is simply the inverse of an exponent. Because 10^3 = 1000, the log base 10 of 1000 is 3. Logarithms turn multiplication into addition and huge ranges of scale into manageable numbers, which is why they appear in everything from earthquake magnitudes to decibels, pH, and computer science. This tool does the arithmetic instantly and privately in your browser, with no setup or sign-in.
How does the logarithm calculator work?
The tool uses the change-of-base rule, the single formula that lets one calculator handle every base:
log_b(x) = ln(x) ÷ ln(b)
Here ln is the natural logarithm, the log to base e (e is about 2.71828). Most processors compute ln directly and accurately, so the calculator takes the natural log of your number, takes the natural log of your base, and divides the first by the second. The result is the logarithm in your chosen base.
The terms involved:
- x is the argument, the number you are taking the log of. It must be greater than 0.
- b is the base, the number being raised to a power. It must be positive and not equal to 1.
- log_b(x) is the result, the exponent that satisfies
braised to that exponent equalsx.
Logarithms are dimensionless, so there are no units in the answer. From the same x, the tool also reports the three most-used bases automatically: ln(x) (base e), log base 10 (the common log, written log in most contexts), and log base 2 (the binary log, written lg or log2).
Examples
Each example below matches the calculator exactly. Type the values into the tool above to reproduce them.
Example 1: log base 10 of 1000
- Question: to what power must 10 be raised to get 1000?
- Change of base:
ln(1000) ÷ ln(10) = 6.907755 ÷ 2.302585 = 3. - Result: log base 10 of 1000 = 3, because
10^3 = 1000.
Example 2: log base 2 of 8
- Question: how many times do you double to reach 8?
- Change of base:
ln(8) ÷ ln(2) = 2.079442 ÷ 0.693147 = 3. - Result: log base 2 of 8 = 3, because
2^3 = 8.
Example 3: ln(e)
- Question: to what power must e be raised to get e?
- Change of base:
ln(e) ÷ ln(e) = 1 ÷ 1 = 1. - Result: ln(e) = 1, because any base raised to the power 1 equals itself.
Example 4: log base 10 of 1
- Question: to what power must 10 be raised to get 1?
- Change of base:
ln(1) ÷ ln(10) = 0 ÷ 2.302585 = 0. - Result: log base 10 of 1 = 0, because
10^0 = 1. The log of 1 is 0 in every valid base.
Common logarithm reference table
This table shows exact log values you can use to check your work. Each row holds because the base raised to the result equals the number.
| Number (x) | Base (b) | log_b(x) | Why |
|---|---|---|---|
| 1000 | 10 | 3 | 10^3 = 1000 |
| 1 | 10 | 0 | 10^0 = 1 |
| 8 | 2 | 3 | 2^3 = 8 |
| 16 | 2 | 4 | 2^4 = 16 |
| e | e | 1 | e^1 = e |
| 100 | 10 | 2 | 10^2 = 100 |
| 1 | 2 | 0 | 2^0 = 1 |
Notice the pattern: the log of 1 is always 0, and the log of the base itself is always 1, no matter which base you choose.
What is a logarithm calculator used for?
Logarithms compress wide-ranging quantities into readable scales, so a log calculator helps across many fields:
- Algebra and precalculus. Solving equations like
b^y = xfor the exponentyis exactly what a logarithm does, and change of base lets you handle any base your textbook throws at you. - Computer science. Log base 2 measures bits, tree depth, and the running time of algorithms like binary search, where log base 2 of 8 = 3 means three comparisons.
- Science and engineering. The pH scale, the Richter scale, and decibels are all logarithmic, so each step represents a tenfold (or other base) change in the underlying quantity.
- Finance. Natural logs of growth ratios turn compounding into simple addition, which is why log returns are common in modeling.
- Music. Pitch is logarithmic in base 2: every octave doubles the frequency, so intervals map cleanly onto log base 2.
Tips and common mistakes
- x must be positive. There is no real logarithm of zero or a negative number, because a positive base can never reach those values. The calculator only accepts
xgreater than 0. - The base cannot be 1. Base 1 always gives 1, so it can never equal another number, and
ln(1) = 0would make the formula divide by zero. - “log” without a base usually means base 10, while “ln” means base e. Mixing these up is the most frequent error; this tool shows both so you never have to guess.
- The log of 1 is 0, and the log of the base is 1. Memorize these two anchors to sanity-check any answer instantly.
- A result can be negative when
xis between 0 and 1 (for a base greater than 1), even thoughxitself stays positive. For example, log base 10 of 0.1 is -1.
Limitations and notes
This calculator computes change of base with standard floating-point arithmetic, so clean answers like 3 may display with tiny rounding artefacts (such as 2.9999999) at the last digit on some inputs; treat results as precise approximations rather than symbolic exact values. It returns real logarithms only, so inputs that violate the rules (x not greater than 0, or base 0, 1, or negative) are rejected rather than producing complex numbers. Everything runs locally in your browser, so your numbers are never uploaded and the tool works offline once the page has loaded. For graded coursework, follow the rounding and significant-figure conventions your instructor or specification requires.
For more number tools, try the scientific notation calculator, square root calculator and percentage calculator in the full math calculators category.
Frequently asked questions
How do you calculate a logarithm in any base?+
Use the change-of-base rule: log_b(x) = ln(x) ÷ ln(b); take the natural log of the number, divide by the natural log of the base, and you get the logarithm in that base.
What is log base 10 of 1000?+
log base 10 of 1000 = 3, because 10 raised to the power 3 equals 1000, so the exponent the base needs is exactly 3.
What is the difference between log and ln?+
log usually means log base 10 (the common log), while ln means the natural log, which is log base e where e is about 2.71828; both answer the same question for different bases.
What is ln(e)?+
ln(e) = 1, because the natural log uses base e, and any base raised to the power 1 equals itself, so log base e of e is 1.
Why must the number be positive?+
A logarithm asks what exponent a positive base needs to reach x; positive bases can never produce zero or a negative result, so log is only defined for x greater than 0.
Why can't the base be 1?+
Base 1 raised to any power is always 1, so it can never equal any other number; the change-of-base formula also fails because ln(1) = 0, which would force a division by zero.
What is log base 2 used for?+
Log base 2 counts how many times you double, so it is central to computer science, information theory, and music intervals; for example log base 2 of 8 = 3.