Logarithm Calculator
Compute log₁₀, ln, log₂, or any custom base using change-of-base.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this logarithm calculator
- Pick a base: log₁₀, ln (base e), log₂, or Custom.
- Enter the number (n) — must be greater than zero.
- If you chose Custom, enter the base (positive and not equal to 1).
- Press Calculate to see the logarithm.
- Use Copy to put the result on your clipboard, or Reset to clear the inputs.
About this logarithm calculator
The logarithm calculator returns log_b(n) — the exponent to which a base b must be raised to produce a number n. It supports the three most common bases (10, e, 2) as quick presets, plus a custom base for any other positive value not equal to 1.
The formula uses change-of-base: log_b(n) = ln(n) ÷ ln(b). This lets a single internal natural-log function compute logarithms in any base. For example, log₁₀(1000) = 3 because 10^3 = 1000. ln(e) = 1 because e^1 = e (and e ≈ 2.71828). log₂(8) = 3 because 2^3 = 8. With a custom base of 5, log_5(125) = ln(125) ÷ ln(5) ≈ 4.8283 ÷ 1.6094 = 3. The calculator only accepts positive numbers for n because log_b(n) is undefined for zero or negative arguments in the real numbers.
As a second concrete example, audio engineers use decibels, defined as dB = 10 × log₁₀(P₂ ÷ P₁). If a speaker has 200 W output versus a reference of 1 W, enter base = 10, number = 200 and multiply the result by 10: log₁₀(200) ≈ 2.301, so the level is about 23.01 dB above reference. Logarithms appear in scientific scales (decibels, pH, Richter), information theory, algorithm analysis, and growth/decay modelling.
FAQ
- What does the logarithm calculator do?
- It returns log_b(n) — the exponent that base b must be raised to in order to produce n. It supports log₁₀, ln, log₂, and any custom positive base not equal to 1.
- What formula does the calculator use?
- It uses change-of-base: log_b(n) = ln(n) ÷ ln(b). Internally the tool computes natural logs and divides to give a logarithm in any base.
- Why must the input be positive?
- log_b(n) is undefined for n ≤ 0 in the real numbers. No real exponent of a positive base will produce zero or a negative result, so the tool rejects those inputs.
- Why is a base of 1 not allowed?
- Every power of 1 is 1, so log_1(n) is undefined for any n ≠ 1 and indeterminate when n = 1. The same is true for bases ≤ 0.
- Does this tool store my numbers?
- No. The calculation runs entirely in your browser; nothing is sent to a server or saved between visits.
- Is the logarithm calculator free?
- Yes. It is free to use with no signup, no account, and no usage limit.