Skip to content
Calcora

Logarithm Calculator

Log of a number in any base, plus natural log.

Input sheet

Browse DIY guidesDo the project yourself, step by step

DIY at your own risk. Calcora's calculators and guides are general estimates and information only — not professional, engineering, legal, or safety advice. Always verify local building codes and permit requirements, and hire a licensed pro for electrical, gas, plumbing, structural, or any work you're not fully comfortable doing yourself.

A logarithm is the inverse of an exponent: it asks what power a base must be raised to in order to reach a number. Logs underpin pH, decibels, the Richter scale, and the running time of efficient algorithms.

How it works

log_b(n) = ln(n) ÷ ln(b): the power b must be raised to in order to get n.

log base b of n equals the exponent x such that b^x = n. This tool computes any base via the change-of-base rule, dividing the natural log of n by the natural log of b, and also reports the natural log, log base 10, and log base 2.

Logs are only defined for positive inputs, and the base must be positive and not equal to 1. The tool flags those cases as undefined.

log base b of n = natural log of n ÷ natural log of b

Worked examples

Tips & gotchas

FAQ

What is the change-of-base formula?

log base b of n equals ln(n) ÷ ln(b), or equivalently log(n) ÷ log(b) in any consistent base. It lets one base compute logs in any other base.

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

No power of a positive base produces a negative result or zero, so the logarithm is undefined there for real numbers.

What is the difference between log and ln?

'log' usually means base 10 in everyday use, while 'ln' is the natural log, base e. Both are logarithms; only the base differs.

Related calculators

Percentage Calculator · Percent Change Calculator · Average (Mean) Calculator · Ratio Calculator · Exponent Calculator