MATHS & STATISTICS / ALGEBRA

Logarithm calculator (any base)

Calculate the logarithm of a number in any base, along with its natural logarithm (ln), common logarithm (log₁₀) and binary logarithm (log₂).

Last reviewed:

← All tools

Your numbers

Use 2.718281828459045 for the natural logarithm.
◈ Your values stay in your browser. No account needed.
YOUR RESULT

Enter your numbers to see a result.

WORKED EXAMPLE

Logarithm calculator (any base): a worked example

With number (x) 1,000, base (b) 10, the logarithm is 3.

Inputs
Number (x)1,000
Base (b)10
Results
Logarithm3
Natural logarithm (ln)6.907755279
Common logarithm (log₁₀)3
Binary logarithm (log₂)9.965784285
THE METHOD

How it works

A logarithm answers the question “what power of the base gives this number?” For example log₁₀(1000) = 3 because 10³ = 1000. Enter the number and the base. Any positive base except 1 works; common choices are 10, 2 and e (about 2.718281828). The number must be positive, because a positive base raised to any real power is never zero or negative.

Formulalog_b(x) = ln(x) ÷ ln(b). The logarithm is the power you raise b to in order to get x: b^y = x.
ASSUMPTIONS

Assumptions and limits

  • The number and the base must be positive, and the base cannot be 1.
  • Results are real-valued; logarithms of negative numbers (which need complex numbers) are not covered.
  • Values are shown to ten significant figures.
  • Results are estimates based on the inputs and assumptions on this page, not professional advice.
  • Try this: use “Save scenario A”, change one input and compare the two results side by side.
QUESTIONS

Frequently asked questions

How is the result of the “Logarithm calculator (any base)” calculated?

log_b(x) = ln(x) ÷ ln(b). The logarithm is the power you raise b to in order to get x: b^y = x. A logarithm answers the question “what power of the base gives this number?” For example log₁₀(1000) = 3 because 10³ = 1000. Enter the number and the base. Any positive base except 1 works; common choices are 10, 2 and e (about 2.718281828). The number must be positive, because a positive base raised to any real power is never zero or negative.

What does the worked example show?

With number (x) 1,000, base (b) 10, the logarithm is 3. Natural logarithm (ln): 6.907755279; Common logarithm (log₁₀): 3; Binary logarithm (log₂): 9.965784285.

What assumptions and limits apply?

This is an estimate based on the inputs and assumptions shown on this page, not professional advice. Check anything with financial, health or safety consequences independently.

Is my data private?

Yes. Calculations run in your browser and your numbers are not sent to a server. A share link contains the inputs you choose to share, so check it before sending it to anyone.

What is the change-of-base formula?

log_b(x) = log_k(x) ÷ log_k(b) for any convenient base k. Calculators usually use k = e, so log₂(32) = ln 32 ÷ ln 2 = 5.

Why can't I take the log of zero or a negative number?

Raising a positive base to any real power always gives a positive result, so no real exponent produces zero or a negative number. As x approaches zero the logarithm falls towards minus infinity.

How do I undo a logarithm?

Raise the base to the result. If log₁₀(x) = 2.5, then x = 10^2.5 ≈ 316.2. The exponent calculator does this step.

FOR WEBSITE OWNERS

Embed this calculator on your site

Free to use. Paste this where you want the calculator to appear. It resizes itself and links back to Calculator786.