Line from intercepts calculator
Intercepts 3 and 2 give the line x/3 + y/2 = 1, which is also 2x + 3y − 6 = 0 and has a slope of −2/3. Enter where the line crosses each axis and get all three forms at once. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- X intercept
- 3
- Y intercept
- 2
- Intercept form
- x/3 + y/2 = 1
- Slope
- -0.6666666667
- Slope intercept
- y = -0.666666666667x + 2
- Standard form
- 2x + 3y - 6 = 0
When a straight line crosses the horizontal axis at a and the vertical axis at b, and neither intercept is zero, the intercept form of its equation is x over a plus y over b equals one. No network calls, no random sampling, and no symbolic engine—only deterministic arithmetic on the two numbers you provide.
How intercept form works and why zeros are rejected
Label the x-intercept as a so the line meets the point (a, 0), and the y-intercept as b so it meets (0, b). When both a and b are non-zero, the classic intercept form is x divided by a plus y divided by b equals one. Clearing denominators multiplies through by a b and yields the linear relation b x plus a y equals a b, which rearranges to standard form b x plus a y minus a b equals zero.
The slope follows immediately: m equals negative b over a, so the slope-intercept equation is y equals m x plus b. If a were zero the line would pass through the origin on the y-axis side of the classic picture and division by a would be undefined; if b were zero the same problem appears for the y term. Horizontal and vertical lines that miss one axis entirely also lack a dual intercept pair of the intercept-form kind.
Negative intercepts are allowed and simply place the crossings in other quadrants; the intercept-form string keeps the signed denominators so students can match textbook answers that write x over negative three plus y over two equals one.
Where a line-from-intercepts calculator shows up in real work
Secondary-school and college analytic geometry courses constantly ask students to write the intercept form of a line when the axis crossings are given first, before converting to slope-intercept or standard form; a trusted calculator with a strict zero-intercept check speeds homework grading and removes spreadsheet mistakes where someone divides by a zero intercept or confuses intercept form with point-slope.
CAD and simple drafting workflows often record where a boundary meets the axes of a local Cartesian frame and need a closed equation for overlays, constraints, or report fields without building a full computational-geometry stack. Game and graphics tutorials that store spawn rails or camera guides as intercept pairs can recover the same algebraic description for debug overlays.
If you later need a line through two arbitrary points, a least-squares fit through many points, or conversion from slope-intercept into standard form alone, treat those as separate search intents rather than overloading this intercept-pair landing.
What you can do with it
Homework and exam checks
Turn given x- and y-intercepts into intercept form, slope-intercept, and standard form, and reject zero intercepts with a clear error.
Drafting and axis-crossing helpers
From two axis crossings, recover a closed line equation for overlays, constraints, and report fields.
FAQ
Are negative intercepts allowed?
Yes. Negative intercepts place the axis crossings in other quadrants; the intercept-form string keeps the signed denominators.
What if an intercept is missing or not a number?
Missing fields, empty strings, non-numeric text, NaN, and Infinity are all rejected.
What does the line from intercepts calculator cost?
The browser tool is free and runs locally.
Why can't an intercept be zero?
The intercept form divides x by a and y by b, and dividing by zero is undefined. A zero intercept is rejected with a message rather than quietly switching to a different kind of equation.
How do I get the slope from the two intercepts?
The slope is minus b over a. With intercepts 3 and 2 it is −2/3, so the slope-intercept form reads y = −2x/3 + 2, where the constant is the y-intercept itself.
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/geom/line-from-intercepts \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"x_intercept":3,"y_intercept":2}'const res = await fetch("https://api.kit.forhosting.com/geom/line-from-intercepts", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"x_intercept": 3,
"y_intercept": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/line-from-intercepts",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"x_intercept": 3,
"y_intercept": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/line-from-intercepts", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"x_intercept":3,"y_intercept":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"x_intercept":3,"y_intercept":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/line-from-intercepts", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"x_intercept": 3,
"y_intercept": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.line_from_intercepts",
"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 line from intercepts calculator accepts the two intercepts as finite numbers, rejects zeros and non-numeric values with a clear invalid_input error, and returns the intercept-form equation string together with the slope, slope-intercept form, and a normalized standard form.
How intercept form works and why zeros are rejected
This capability therefore treats a zero intercept as invalid_input rather than inventing a different equation family. Because every step is a handful of multiplications and divisions, the path is O(1), free of iterative solvers, and identical between browser and API.
What you send and what you get back
Wire the free browser tool for quick sanity checks, then call the identical contract from scripts when you need bulk evaluation without reimplementing the zero-intercept gate in every language. Provide two required finite numbers: x_intercept (aliases a and x_int) and y_intercept (aliases b and y_int). Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input and are not charged. A zero x_intercept or y_intercept also fails with a message that intercept form is undefined when that intercept is zero. On success the JSON response echoes the normalized intercepts, returns intercept_form as a compact equation string such as x/3 + y/2 = 1, returns slope as the number negative b over a, returns slope_intercept as a readable y equals m x plus b string, returns standard as an object with coefficients A, B, and C for A x plus B y plus C equals zero, returns standard_form as a human-readable equation, and includes a short formula field restating the intercept identity. Example check: x_intercept three and y_intercept two yields intercept form x/3 + y/2 = 1, slope negative two thirds, slope-intercept y equals negative two thirds x plus two, and a reduced standard form proportional to two x plus three y minus six equals zero. API pricing is the published base of $0.002 per successful item.
Where a line-from-intercepts calculator shows up in real work
Because this capability is a pure parse engine, failed validation does not consume balance and successful runs stay at $0.002 per item.
Integration use cases
Deterministic geometry fixtures
Generate stable intercept-form strings and coefficient triples for unit tests and teaching answer keys.
Technical questions
What equation does this calculator return?
Primarily intercept form x/a + y/b = 1, plus slope, slope-intercept y = mx + b, and standard form Ax + By + C = 0 with numeric A, B, C.
Why must intercepts be non-zero?
Intercept form divides by each intercept. If a or b is zero, x/a + y/b = 1 is undefined; the request fails with invalid_input.