Natural log calculator
Find the natural logarithm of any positive number: ln 1 is 0, ln e is 1 and ln 10 is about 2.30258509299. The answer is the power to which e, about 2.718281828, must be raised to give your number. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Value
- 1
- Ln
- 0
- Expression
- ln(1)
The natural logarithm of a number, written ln(x) or log base e of x, is the unique real exponent that raises Euler's number e to recover that number. It is the logarithm whose base is e, about 2.718281828, and it is the inverse of the real exponential function. Identities you can pin in tests include ln of one equals zero and ln of e equals one.
What the natural logarithm is and why the domain is x greater than zero
The natural logarithm ln(x) is the logarithm with base e, Euler's number, the unique real number such that e to the power ln(x) equals x. Equivalently, ln(x) is the unique real y satisfying exp(y) equals x, so the two functions invert each other on the positive reals. Geometrically, ln(x) is the signed area under the curve one over t from one to x: that area is positive when x is greater than one, zero when x is one, and negative when x sits strictly between zero and one.
Algebraically the function obeys the familiar laws: ln of a product is a sum of logs, ln of a quotient is a difference, and ln of a power is the exponent times the log. Those identities are why continuous compounding, half-life formulas, and entropy sums are written with ln rather than with a logarithm of another base. The domain is the open interval of strictly positive reals.
Zero has no real logarithm because no finite power of e equals zero. A negative argument has no real logarithm because e to any real power is positive. Infinity and NaN are not numbers the contract can return as a successful ln.
This calculator therefore refuses a non-positive or non-finite input instead of inventing minus infinity, a complex value, or a hollow empty success. Related searches such as a general logarithm calculator that also asks for a base, or a common log of base ten, are different intents. Here the contract is the scalar natural log of a single positive number, the quantity students type as natural log calculator or ln calculator when they want ln(x) and nothing else.
Which numbers work and what the result shows
Zero, including negative zero, and any negative number are rejected because the real natural logarithm is undefined there. On success the body echoes the cleaned value, returns ln as the primary result, and includes a formula string ln(x) equals log base e of x, a compact expression such as ln(1) or ln(2.71828182846), and a one-line message. Example: value one yields ln zero, because e to the power zero is one.
Example: value e, about 2.718281828459, yields ln one. Example: value ten yields ln about 2.30258509299, the change-of-base constant that converts common logs to natural logs. For log base b of x use a general logarithm calculator; this page solves only the natural logarithm and keeps the landing aligned with that single search.
Where a natural log calculator earns its keep
Classrooms and tutoring platforms use a natural log calculator so learners can check ln of an arbitrary positive decimal without mixing it up with log ten or with a log of a guessed base. Exam generators need a deterministic oracle that marks zero and negatives as undefined instead of silently returning minus infinity, which many language runtimes do and which a buggy grader might treat as a number. Failed validation does not consume balance.
Keep requests small, pin the rounded ln in tests, and you get a reproducible natural logarithm for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own. Related searches such as log base b or discrete logarithm modulo a prime are different problems and are served by other pages; this contract stays on ln(x) so the landing matches what a student actually types when looking for the natural log.
What you can do with it
Classroom and homework checks
Let students submit a positive finite number and verify ln(x), including the identities ln(1)=0 and ln(e)=1, against textbook methods.
Exam and LMS auto-grading
Mark natural-log items with a deterministic oracle that rejects zero and negatives as undefined and never invents minus infinity as a successful ln.
Growth rates and log-likelihoods
Evaluate ln of a scale factor, remaining fraction, or likelihood term in a script without importing a computer-algebra library for a one-line ln(x).
FAQ
Is this the same as log10 or a general log base b?
No. This calculator returns only the natural logarithm ln(x), the log with base e. A common log or a log with an arbitrary base is a different tool.
What is the natural log of 1 and of e?
ln(1) is 0 because e to the power 0 is 1. ln(e) is 1 because e to the power 1 is e.
What happens if I enter zero or a negative number?
It is refused, because no real power of e equals zero or a negative number. You get a clear message instead of minus infinity or a complex value, so a slip in your data shows up at once.
Why is the natural log of a number below 1 negative?
Because e must be raised to a negative power to give a number between 0 and 1. Seen as the area under the curve one over t, it is measured backwards from 1, so it comes out negative.
Which rules does the natural log follow?
The log of a product is the sum of the logs, the log of a quotient is their difference, and the log of a power is the exponent times the log. That is why growth and decay formulas use it.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/math/natural-log \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"value":1}'const res = await fetch("https://api.kit.forhosting.com/math/natural-log", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/natural-log",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"value": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/natural-log", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"value":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"value":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/natural-log", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"value": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.natural_log",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This calculator accepts a single positive finite number, returns that natural log, and rejects zero, negatives, and non-finite tokens with invalid_input so homework scripts never treat a missing logarithm as a successful zero.
Input contract, response shape, and error behaviour
POST a JSON body with the required field value, a strictly positive finite number. The field may arrive as a JSON number or as a numeric string in decimal or scientific notation; aliases x, n, number, and arg are accepted when value is omitted. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not billed. Pair the payload with your own labels; this endpoint does not emit plots, complex logs, or a log in another base.
Where a natural log calculator earns its keep
Science and finance notebooks invert exponential growth, convert between e-folding times and rates, and evaluate log-likelihood terms; calling a tiny parse API avoids pulling a computer-algebra system for a one-line ln.
Technical questions
How do I compute the natural logarithm of a number?
Send a positive finite number as value (aliases x, n, number, or arg). The API returns ln = log_e(value) together with a short expression such as ln(1).
What happens if the number is zero or negative?
The task fails with invalid_input. The real natural logarithm is defined only for x greater than zero, so the request is rejected and is not billed.
What does the natural log calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.