Home › Math › Logarithm Calculator
Logarithm Calculator
Computes the logarithm of a positive number to any base using the change-of-base formula, and always reports the natural, common (base 10) and binary (base 2) logarithms.
When to use
You need log_b(x) for an arbitrary base, or ln, log10 and log2 of a number at once.
Do not use when: You need to raise a base to a power (use exponent) or a root (use nth-root); for pH-style −log10 of a concentration use ph.
Formula
log_b(x) = ln(x) / ln(b) (change of base); ln = log_e, log10 = log_10, log2 = log_2
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
value | number | yes | Positive number whose logarithm is taken. Range: > 0 | |
base | number | default 10 | Logarithm base; positive and not 1. Use 2.718281828459045 for the natural logarithm, or read the ln output. Range: > 0 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
log | number | Logarithm of value to the given base. | |
ln | number | Natural logarithm (base e). | |
log10 | number | Common logarithm (base 10). | |
log2 | number | Binary logarithm (base 2). | |
expression | string | The evaluated logarithm as text. |
Example
log10 of 1000: {"value":1000,"base":10} → {"log":3,"ln":6.907755,"log10":3,"log2":9.965784,"expression":"log_10(1000) = 3"}
log2 of 8: {"value":8,"base":2} → {"log":3,"ln":2.079442,"log10":0.90309,"log2":3}
GET https://tttkmbb.com/api/v1/calculate/logarithm?value=1000&base=10
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/logarithm(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/logarithm · Markdown: https://tttkmbb.com/math/logarithm.md · JSON definition: https://tttkmbb.com/math/logarithm.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="logarithm" - OpenAPI operationId:
calculate_logarithm - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
FAQ
Why can't the value be 0 or negative?
Real logarithms are only defined for positive numbers: log(0) tends to −∞ and logarithms of negatives are complex.
Which base does 'log' mean?
In science and calculators 'log' usually means base 10, in mathematics often base e, and in computing base 2. All three are reported so no convention is assumed.
Related calculators
- Exponent Calculator — Inverse operation: b^y = x.
- Nth Root Calculator — Roots as fractional exponents.
- pH Calculator — pH is −log10 of hydrogen-ion concentration.