Quick answer
The logarithm log_b(x) is the power to which the base b must be raised to get x, and it equals ln(x) ÷ ln(b). log₂(8) = 3 because 2³ = 8; the same number has ln 8 = 2.079442 and log₁₀ 8 = 0.90309.
Enter a number and a base. The calculator returns the logarithm in that base, the natural log and the common log.
Related tools: Slope Calculator: Slope, angle, distance and line equation through two points. LCM Calculator: Least common multiple of two or more numbers. Factor Calculator: List every factor of a positive whole number.
How to use the Log Calculator
- Enter number x (above 0).
- Enter base b (above 0). It starts at 10.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| Number x | A number | > 0 |
| Base b | A number | > 0, starts at 10 |
Formula and method
Formula
log_b(x) = ln(x) ÷ ln(b)
IEEE-754 double precision; shown to at most 6 decimal places.
Change of base using natural logarithms.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: Number x = 8; Base b = 2.
| Result | Value |
|---|---|
| log base 2 of 8 | 3 |
| Natural log (ln) | 2.079442 |
| Common log (log₁₀) | 0.90309 |
Example 2
Inputs: Number x = 2.718281828459045; Base b = 2.718281828459045.
| Result | Value |
|---|---|
| log base 2.718281828459045 of 2.718281828459045 | 1 |
| Natural log (ln) | 1 |
| Common log (log₁₀) | 0.434294 |
Example 3
Inputs: Number x = 1; Base b = 7.
| Result | Value |
|---|---|
| log base 7 of 1 | 0 |
| Natural log (ln) | 0 |
| Common log (log₁₀) | 0 |
The first line is the headline result (log base 2 of 8). Below it the log Calculator lists natural log (ln) and common log (log₁₀), which describe the same case from other angles. IEEE-754 double precision; shown to at most 6 decimal places.
Rules worth knowing
log(xy) = log x + log y, log(x ÷ y) = log x − log y and log(xⁿ) = n log x. Changing base uses log_b(x) = ln(x) ÷ ln(b), which is how the result for any base is computed from natural logs.
Domain
x must be positive, since no power of a positive base is zero or negative, and the base must be positive and not 1, because 1 raised to any power is 1. log of 1 is 0 in every base.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- Base b: entering "1" shows "The base must not be 1." beside that field and no result.
- Number x: entering "0" shows "Number x must be greater than 0." beside that field and no result.
Choosing between the Log Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Slope Calculator](/math/slope-calculator/) | x₁, y₁ and x₂ | Slope |
| [LCM Calculator](/math/lcm-calculator/) | numbers | Least common multiple |
| [Factor Calculator](/math/factor-calculator/) | number | Factors |
| [Quadratic Formula Calculator](/math/quadratic-formula-calculator/) | a, b and c | Roots |
| [GCF Calculator](/math/gcf-calculator/) | numbers | Greatest common factor |
Background: algebra
Many algebra calculators rest on the same ideas: write the problem in a standard form, identify the coefficients, apply the formula and check the answer by substituting it back. For a quadratic ax² + bx + c = 0 the roots are (−b ± √(b² − 4ac)) ÷ 2a, and the discriminant b² − 4ac decides the kind of roots: positive gives two real roots, zero gives one repeated root and negative gives two complex conjugate roots.
If a = 0 the equation is linear, not quadratic. A sign slip on the −b term shifts both roots by the same amount, so substitute your roots back to check.
Assumptions and limitations
- x must be positive
- Base must be positive and not 1
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for base b and number x to confirm this.
Frequently asked questions
What is the difference between log and ln?
log usually means base 10 and ln means base e (about 2.71828).
What is log of 100?
2 in base 10, because 10² = 100.
Can a log be negative?
Yes, when x is between 0 and 1: log₁₀(0.1) = −1.
What does the Log Calculator calculate?
Logarithm of a number to any base. It returns log base 2 of 8, Natural log (ln) and Common log (log₁₀).
What formula does the Log Calculator use?
log_b(x) = ln(x) ÷ ln(b). Change of base using natural logarithms.
What do I need to enter in the log Calculator?
You enter Number x and Base b.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. x must be positive.
What are the limits of this calculator?
x must be positive. Base must be positive and not 1.
What is an example of a log result?
With number x 8 and base b 2, the log base 2 of 8 is 3.
Related calculators
- Slope Calculator — Slope, angle, distance and line equation through two points.
- LCM Calculator — Least common multiple of two or more numbers.
- Factor Calculator — List every factor of a positive whole number.
- Quadratic Formula Calculator — Solve ax² + bx + c = 0, including complex roots.
- GCF Calculator — Greatest common factor (greatest common divisor) of two or more numbers.
- Matrix Calculator — Determinant, trace, transpose and 2×2 inverse of a matrix.
Sources
- OpenStax, Algebra and Trigonometry 2e (Rice University): exponents, radicals, logarithms and inverse trigonometric functions
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.