One-to-one function checker
Find out whether a function has an inverse before you try to build one: f(x) = 2x − 1 passes the horizontal line test, because every output comes from exactly one input. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Kind
- Linear
- A
- 2
- B
- -1
- Expression
- 2x-1
- Domain name
- all real numbers
- Domain code
- all_reals
- Horizontal line test
- pass
A function is one-to-one, or injective, when different inputs never produce the same output. That single property is exactly what the horizontal line test captures on a graph: if every horizontal line meets the curve in at most one point, the function is one-to-one and therefore invertible onto its range. Students meet the test when they prepare inverse functions, restrict quadratic domains, or decide whether an exponential or logarithm already has an inverse without further surgery. Teachers and LMS authors need a deterministic oracle that states pass or fail with a short reason, not a vague plot. This one-to-one function checker accepts a common algebraic family—linear, quadratic, absolute value, cubic, exponential, logarithmic, reciprocal, power, or square root—optional coefficients, and an optional domain restriction, then returns whether the horizontal line criterion passes, whether the map is invertible, a display expression, and a plain-language reason.
What the horizontal line test decides
The horizontal line criterion is the graphical twin of the algebraic definition of injectivity. Algebraically, f is one-to-one on a domain D when f(x1) equals f(x2) forces x1 equals x2 for every pair in D. Graphically, that means no horizontal line y equals k can intersect the graph more than once inside D.
When the test passes, each output value in the range comes from exactly one input, so you can reverse the arrows and obtain a well-defined inverse function from the range back to D. When the test fails, at least one output is shared by two inputs, and any attempted inverse would have to return two values at once. Classic failures include even powers such as x squared on all real numbers, absolute value V-shapes on the full line, and parabolas that open on both sides of their vertex.
Classic passes include non-constant linear maps, exponential growth and decay with a valid base, logarithms on their native half-line, odd-degree power maps, and square-root branches on x greater than or equal to the shift. Cubics are subtler: some are strictly monotonic on the whole line (for example x cubed), while others wiggle through a local max and min and fail the test until you cut the domain.
This checker encodes those family-specific rules with explicit domain options such as all reals, one-sided rays, and vertex half-lines for parabolas and absolute value, so you can state the same conclusion a textbook draws after sketching the graph—without relying on pixels or a computer-algebra kernel.
Where a one-to-one checker earns its keep
Algebra courses use a one-to-one function checker so learners can confirm that y equals two x plus one is invertible while y equals x squared on all reals is not, then immediately re-test x squared on x greater than or equal to zero and watch the verdict flip—an interactive way to internalize domain restriction before inverse functions are formalized. Exam generators and LMS plugins need a deterministic oracle that never invents a pass for a cubic with two turning points or a fail for a pure exponential.
Content sites ranking for phrases such as one to one function checker or horizontal line test calculator benefit from a live tool whose free tier matches the automation contract byte for byte.
What you can do with it
Classroom inverse-function prep
Let students submit a family and domain, see whether the horizontal line test passes, and only then attempt to write an inverse formula.
LMS and exam auto-grading
Mark injectivity items with a deterministic oracle that distinguishes full-line parabolas from vertex half-line restrictions.
Curriculum and content widgets
Embed a free one-to-one function checker on lesson pages targeting horizontal line test and invertible function search intent.
FAQ
What does the one-to-one function checker test?
It applies the horizontal line criterion to a declared algebraic family and domain, returning whether the function is injective (one-to-one) and therefore invertible onto its range, plus a short reason.
Is every one-to-one function reported as invertible?
Codomain choices outside the range are left to the caller.
Is x squared one-to-one?
Not on all real numbers: x and −x give the same output, so a horizontal line can cross the parabola twice. Restrict the domain to one side of the vertex and the test passes.
Which kinds of functions can I check?
Linear, quadratic, absolute value, cubic, exponential, logarithmic, reciprocal, power and square root functions. You can add coefficients and, for parabolas and V-shapes, limit the domain to one side of the vertex.
Are all cubic functions one-to-one?
No. A cubic such as x cubed rises steadily and passes, but a cubic with a local maximum and minimum repeats outputs and fails until you cut its domain.
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/algebra/one-to-one-function-check \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"kind":"linear"}'const res = await fetch("https://api.kit.forhosting.com/algebra/one-to-one-function-check", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"kind": "linear"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/one-to-one-function-check",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"kind": "linear"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/one-to-one-function-check", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"kind":"linear"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"kind":"linear"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/one-to-one-function-check", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"kind": "linear"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.one_to_one_function_check",
"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
Input contract, families, and response shape
POST a JSON body whose required field is kind: one of linear, quadratic, absolute, cubic, exponential, logarithmic, reciprocal, power, or square_root. Optional coefficients a, b, c, d, n, base, h, and k follow the same naming spirit as related algebra tools: linear is ax plus b, quadratic is a x squared plus b x plus c, absolute is the modulus of a x plus b plus outer constant c, cubic is a x cubed plus b x squared plus c x plus d, exponential is a times base to the x plus k, logarithmic is a times log base of x minus h plus k, reciprocal is a over x minus h plus k, power is a times x to the n plus k, and square_root is a times the principal square root of x minus h plus k. Domain defaults to the family-native set—all reals for linear, quadratic, absolute, cubic, and exponential; a positive or nonnegative ray for logs, roots, and non-integer powers; the punctured line for reciprocals—but you may pass nonnegative, positive, nonpositive, negative, right_of_vertex, or left_of_vertex when you are deliberately restricting a parabola or V-graph so that an inverse exists. Invalid combinations throw invalid_input: zero leading coefficients where the family would collapse, exponential or log bases that are non-positive or equal to one, vertex-only domain codes on families that have no vertex, and log or root requests on domains that leave the real principal branch. On success the body echoes kind, a compact expression string, a human domain label, domain_code, the coefficients you effectively used, is_one_to_one, is_invertible (equal to the injectivity flag for real functions onto their range), horizontal_line_test as pass or fail, a reason paragraph suitable for UI copy, and method set to horizontal_line_criterion. When a failure is easy to witness, optional witness_x1 and witness_x2 point at distinct inputs that share a horizontal level. The free browser path and the prepaid API share the same pure module, so a classroom demo and a grading script see identical booleans for the same payload.
Where a one-to-one checker earns its keep
Engineering notebooks sometimes only need a quick injectivity gate before calling a symbolic inverse or fitting a calibration curve that must be reversible; a tiny parse endpoint avoids pulling a full computer-algebra system for textbook families. Keep requests small, pin the boolean flags and reason keywords in tests, and you get reproducible horizontal-line decisions for homework, curriculum sites, and edge workers without standing up graphing infrastructure of your own.
Technical questions
Which function types are supported?
linear, quadratic, absolute, cubic, exponential, logarithmic, reciprocal, power, and square_root, with optional coefficients a, b, c, d, n, base, h, k and optional domain restrictions.
When does a quadratic pass the horizontal line test?
Never on all real numbers when a≠0. It passes on a single branch: right_of_vertex, left_of_vertex, or a one-sided ray that does not place the vertex in the interior of the domain.
What does the one-to-one function checker cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.