Y-intercept calculator
Give a slope and a point, or two points, and get the spot where the line crosses the vertical axis: slope 2 through the point (3, 7) crosses at 1. The slope and the equation come with it. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Slope
- 2
- X
- 3
- Y
- 7
- Y intercept
- 1
- Equation
- y = 2x + 1
The y-intercept of a line is the y-value where that line crosses the vertical axis. Students meet it as the constant b in the slope-intercept equation y equals m x plus b, graphing units ask for it from a known slope and one plotted point or from two distinct points, and automation scripts need the same number without importing a computer-algebra system. This y-intercept calculator accepts either a finite slope plus the coordinates of one point, or two distinct points that define a non-vertical line, and returns the intercept together with the implied slope, a compact slope-intercept equation string, and a short formula reminder you can show next to the answer. Missing fields and non-finite numbers fail the same way.
What the y-intercept is and how both formulas produce it
The y-intercept is the unique y-coordinate of the point where a non-vertical line meets the y-axis, the place where x equals zero. In slope-intercept form that number is the constant b in y equals m x plus b, so reading it off an already-arranged equation is trivial; the work starts when the data you have is not already arranged that way.
If you know a finite slope m and one point with coordinates x and y that lies on the line, rearrange the point-slope identity: y minus the intercept equals m times x, so the intercept equals y minus m times x. If instead you know two distinct points, first form the slope as rise over run, y-two minus y-one over x-two minus x-one, then substitute either point into the same identity. Both routes describe the same geometric object: the unique non-vertical line through the given data.
A horizontal line has slope zero and its intercept is simply the shared y-coordinate of every point on it. A vertical line never meets the y-axis at a finite point, so there is no real intercept to report. This calculator does not plot the line, convert to standard form, or solve for the x-intercept: those are neighbouring jobs.
It only evaluates b, echoes the slope it used, and returns a compact y equals m x plus b string plus a formula reminder so a client can display the derivation next to the number without re-deriving the algebra. Search traffic for a y-intercept calculator is looking for that single axis crossing, which is why this landing has its own type and its own slug.
Where it helps and what it does not do
Algebra classrooms and tutoring platforms use a y-intercept calculator so learners can check b from a slope and a point, or from two plotted points, without a sign error in the subtraction. Exam-prep generators and LMS plugins need a deterministic oracle that marks a vertical pair as invalid instead of accepting Infinity as a passing answer.
Engineering notebooks often start from a calibrated gradient and one measured sensor point, or from two calibration samples, and need the axis crossing before they store y equals m x plus b for later interpolation. Failed validation does not consume balance. Keep requests small, pin the rounded intercept and equation string in tests, and you get a reproducible b for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.
What you can do with it
Classroom and homework checks
Let students submit a slope and a point, or two plotted points, and verify the y-intercept against the textbook identity b = y − m x.
Exam and LMS auto-grading
Mark intercept items with a deterministic oracle that rejects a vertical pair as undefined and never invents Infinity as a passing answer.
Calibration notebooks
Turn a measured point plus a known gradient, or two calibration samples, into the axis crossing stored as y = mx + b.
FAQ
How do I find the y-intercept from two points?
Send finite numbers x1, y1, x2, and y2. The engine forms m = (y2 − y1) / (x2 − x1) and then b = y1 − m·x1. The two points must not share an x-coordinate.
Is this the same as a line-equation or slope calculator?
No. This landing returns the y-intercept as the primary answer. A slope calculator reports m; a line-equation tool emits full forms. Those are different searches and different tools.
How do I find the y-intercept from a slope and one point?
Multiply the slope by the point's x-coordinate and subtract the result from its y-coordinate. For slope 2 and the point (3, 7), that is 7 minus 2 times 3, which leaves 1.
What happens if the two points form a vertical line?
There is no y-intercept, because a vertical line never meets the vertical axis at a single point. The calculator reports that case clearly instead of returning a made-up number.
What is the y-intercept of a horizontal line?
It is simply the y-coordinate that every point on the line shares. A horizontal line has a slope of zero, so it crosses the vertical axis at that same height.
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/y-intercept \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"slope":2}'const res = await fetch("https://api.kit.forhosting.com/math/y-intercept", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"slope": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/y-intercept",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"slope": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/y-intercept", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"slope":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"slope":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/y-intercept", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"slope": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.y_intercept",
"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.
Limits
max_abs | 1000000000000000 |
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
When two points share an x-coordinate the line is vertical, the intercept is undefined, and the task fails with invalid_input rather than inventing Infinity. A successful API call costs $0.002; invalid input is not billed.
Input contract, vertical lines, and the response shape
Mixing both shapes without an explicit mode fails so a half-filled form cannot silently pick the wrong route. Two coincident points do not define a unique line and fail. Two points with the same x-coordinate define a vertical line, so the y-intercept is undefined and the task fails with a message that names the vertical case instead of returning Infinity. Example: slope two, x three, y seven yields intercept one because seven minus two times three is one. Example: points one, three and three, seven yield the same intercept one after the slope two is formed from rise four over run two. Validation failures are not billed. Send a JSON body in one of two shapes. Point-slope mode takes finite numbers slope, x, and y; aliases m and gradient are accepted for slope, and x-zero, px, or point-x for the point. Two-point mode takes finite numbers x1, y1, x2, and y2 with the matching short aliases. Optional mode may be point_slope or two_points; omit it and the engine infers the shape from which fields you sent. Each numeric field may arrive as a JSON number or as a decimal or scientific string; missing fields, empty strings, not-a-number values, and infinities fail with invalid_input and name the offending field. Absolute magnitudes above one quadrillion are rejected so the product stays finite in IEEE double precision. On success the body reports y_intercept as the primary value, slope as the gradient used, method as point_slope or two_points, equation as a compact y equals m x plus b string, formula restating the identity, and the echoed coordinates for the mode that ran. A successful API request is charged the published $0.002 base price with unit item.
Technical questions
How do I find the y-intercept from a slope and a point?
Send finite numbers slope, x, and y. The API returns y_intercept = y − m·x, plus the slope, a y = mx + b string, and a formula reminder.
What happens if the two points form a vertical line?
The task fails with invalid_input. A vertical line never meets the y-axis at a finite point, so the y-intercept is undefined and the request is not billed.
What does the y-intercept calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.