Logarithm Calculator
Calculate log base b of x for any base, with ln, log10 and log2 and exact answers like log8 32 = 5/3. Also finds x from a log, or the unknown base.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Logarithm Calculator?
A logarithm answers one question: what power do I raise the base to in order to get this number? Type the number and the base (10, e, 2 or anything else positive except 1) and the calculator gives the answer to 30 significant digits, along with the natural log, the common log and the binary log of the same number.
When the answer is a rational number the calculator says so: log₂ 1024 = 10, log₁₀ 0.001 = −3, and log₈ 32 = 5/3 exactly, because 8^(5/3) = 32. Each exact answer is confirmed with whole-number arithmetic, not guessed from a decimal that happens to look round.
Two other modes work the equation backwards. Antilog finds x from bʸ = x, for example turning a pH of 7.4 into a hydrogen-ion concentration of 10^−7.4. Base mode finds b from log_b(x) = y, such as the base whose cube is 8.
- Logarithms in any positive base, including e and fractions
- ln, log₁₀ and log₂ of the same number side by side
- Exact rational answers verified with integer arithmetic
- Antilog and solve-for-base modes
- 30 significant digits with characteristic and mantissa
How to use the Logarithm Calculator
- Choose what to solve for: the logarithm, the number x (antilog), or the base b.
- Type the base, or tap log₁₀, ln or log₂. Type e for the natural log.
- Type the number x. It must be positive; fractions, decimals and E notation such as 1e500 are accepted.
- Read the result. Exact answers, including fractions like 5/3, are labelled exact.
- Use the ln, log₁₀ and log₂ cards for the same number in other bases, and the steps for the change-of-base working.
Worked examples
A fractional log
Input
log₈ 32
Output
5/3
8 = 2³ and 32 = 2⁵, so 8^(5/3) = 2⁵ = 32. The calculator verifies 32³ = 8⁵ exactly before calling it 5/3.
Natural log of 10
Input
ln 10
Output
2.30258509299404568401799145468
This constant converts between natural and common logs: log₁₀ x = ln x / 2.302585….
Bits for a number
Input
log₂ 1000
Output
9.96578428466208704361095828847
Just under 10, so 1000 fits in 10 bits but not 9.
Antilog for pH
Input
10^−7.4
Output
3.98107170553497250770252305088 × 10^-8
Blood at pH 7.4 has a hydrogen-ion activity of about 4.0 × 10⁻⁸ mol/L.
Background and insight
log_b(x) = y means exactly the same as bʸ = x. Logarithms turn multiplication into addition, log(ab) = log a + log b, which is why John Napier introduced them in 1614 and why astronomers and engineers used log tables and slide rules for the next 350 years. Common logs (base 10) were the practical choice because shifting the decimal point only changes the whole-number part, the characteristic, while the fractional part, the mantissa, stays the same.
Any logarithm can be computed from any other with the change-of-base formula, log_b(x) = ln x / ln b = log₁₀ x / log₁₀ b. The calculator uses it with 80-digit arithmetic and then checks for an exact rational answer by testing whether x^q = b^p for the closest small fractions p/q. That is how it can report log₈ 32 = 5/3 instead of 1.666666….
Many everyday scales are logarithmic. pH is −log₁₀ of the hydrogen-ion activity, the decibel is 10 × log₁₀ of a power ratio, and earthquake magnitudes grow by one for each tenfold increase in wave amplitude. Binary logs count bits and halvings: log₂ of a number is how many times you can halve it before reaching 1, which is why it appears in algorithm running times.
Common use cases
Algebra and precalculus
Check log equations, change-of-base problems and exact fractional answers with the steps shown.
Chemistry
Convert between pH and concentration, or between pKa and Ka, with the antilog mode.
Sound and signals
Work out the log₁₀ of power or amplitude ratios behind decibel figures.
Computer science
Find how many bits a value needs or how many halvings a binary search takes with log₂.
Tips and limitations
- The logarithm of zero or a negative number is not a real number; the calculator explains why rather than returning an error code.
- Base 1 is not allowed because 1 raised to any power is 1.
- For numbers of 1 or more, floor(log₁₀ x) + 1 is the number of digits before the decimal point.
- Values like 1e500 are beyond normal calculator range but are fine here because the input is kept exact.
Frequently asked questions
What is a logarithm?
log_b(x) is the exponent y that makes bʸ = x. log₁₀ 1000 = 3 because 10³ = 1000, and log₂ 8 = 3 because 2³ = 8.
How do I calculate a log in a base my calculator does not have?
Use change of base: log_b(x) = ln x / ln b, or log₁₀ x / log₁₀ b. log₅ 100 = ln 100 / ln 5 ≈ 4.60517 / 1.60944 ≈ 2.86135. This calculator takes any base directly.
What is the difference between ln and log?
ln is the natural logarithm, base e ≈ 2.71828. log usually means base 10 on calculators and in science, but in mathematics and many programming languages log means the natural log. ln x = 2.302585… × log₁₀ x.
What is an antilog?
The inverse of a log: if log_b(x) = y then x = bʸ. The antilog of 2 in base 10 is 100. Use the Antilog mode and type the base and y.
Why can't you take the log of zero or a negative number?
A positive base raised to any real power is always positive, so no real exponent produces 0 or a negative result. As x approaches 0 from above, log x falls toward minus infinity.
How can a logarithm be a fraction?
When x is a root of a power of the base. 32 is the cube root of 8⁵, so log₈ 32 = 5/3. The calculator searches for such fractions and confirms them exactly.
What are the characteristic and mantissa?
They are the integer part and the fractional part of log₁₀ x. log₁₀ 1024 = 3.0103, with characteristic 3 and mantissa 0.0103. Old log tables listed only mantissas because the characteristic just tracks the decimal point.
Is there an in-depth guide to the Logarithm Calculator?
Yes. “Logarithms Explained: Bases, ln, Change of Base and Real Uses” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
People also search for
- how to calculate log base 2 of a number
- change of base formula for logarithms
- log base 8 of 32 as a fraction
- how to find the antilog of a number
- natural log vs log base 10
- why is log of a negative number undefined
- solve for the base of a logarithm
- how many bits do i need for a number
Related Tools You May Like
Free, in-browser tools that pair well with this one.