calculator.onl
Categories50

Logarithm calculator

Calculate a logarithm in any valid positive base, plus natural, decimal and binary logarithms.

A worked example

Keep base 2 and change the argument from 8 to 32. The cursor moves from the third to the fifth power of 2.

Logarithm to selected base3Natural logarithm2.0794Base-10 logarithm0.9031Base-2 logarithm3
Positive argument. Decimal and scientific notation are accepted.

Positive base other than 1. Bases below 1 are valid.

Updates as you type

Use x and base from 1e−100 to 1e100, both positive; base cannot equal 1. Scientific notation is accepted.

YOUR RESULT

Logarithm to selected base

3

Calculated from your inputs

Natural logarithm2.0794
Base-10 logarithm0.9031
Base-2 logarithm3
The numbers, at a glance

Calculations run in your browser.
UNDERSTAND THE RESULT

A little context. A clearer answer.

↑ Back to calculator

When this calculator is useful

Calculate a logarithm in any valid positive base, plus natural, decimal and binary logarithms. Enter your values and inspect the calculation details. For a related calculation, try Exact integer power calculator.

What to enter

InputWhat it meansExample value
Positive argument xPositive argument. Decimal and scientific notation are accepted.8
Logarithm basePositive base other than 1. Bases below 1 are valid.2

How the calculation works

  1. Validate x > 0, b > 0 and b ≠ 1.
  2. Use log_b(x) = ln(x)/ln(b), with log1p near 1 for numerical stability.
  3. Also calculate ln(x), log₁₀(x) and log₂(x); the plot uses a logarithmic horizontal axis.
The formulalog_b(x) = ln(x)/ln(b); x > 0; b > 0; b ≠ 1

A worked example

Worked example: x = 8 and b = 2 gives log₂(8) = 3, ln(8) ≈ 2.079442 and log₁₀(8) ≈ 0.90309.

Example you can load

What to enter
Result for this example · Logarithm to selected base3

This is a fixed example; changing the form above does not change these numbers.

Assumptions & limits

Both argument and base must be between 1e−100 and 1e100; the base cannot equal 1. Results use floating-point arithmetic. Values indistinguishable from 1 at machine precision are treated as 1.

Frequently asked questions

Can the base be below 1?

Yes. For 0 < b < 1 the logarithm decreases as the argument increases.

Why is base 1 invalid?

Every power of 1 is 1, so it cannot define a unique inverse logarithm.

Can I enter a negative argument?

No. This tool calculates real logarithms of positive numbers only.