Line intersection calculator
The lines y equals 2x + 1 and y equals −x + 4 cross at the point (1, 3). Enter two lines in slope-intercept or standard form and get their meeting point, or a plain message when they are parallel or identical. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Form
- Slope intercept
- M1
- 2
- B1
- 1
- M2
- -1
- B2
- 4
- X
- 1
- Y
- 3
The line intersection calculator finds the unique point where two straight lines meet on the Cartesian plane. Enter each line in slope-intercept form y equals m x plus b, or in standard form a x plus b y plus c equals zero; the engine solves the two-by-two linear system and returns the coordinates of the intersection together with the equations it used. When the equations are proportional the lines are coincident and every point on the line is an intersection, which is also rejected because the contract promises a single unique point. Results are deterministic floating-point arithmetic with no random sampling and no network call.
What line intersection means and what you get back
In analytic geometry two distinct non-parallel lines in the plane intersect in exactly one point. Slope-intercept form writes each line as y equals m x plus b, so the slope m is the constant rate of change of y with respect to x and b is the y-intercept where the line crosses the vertical axis. Setting the two expressions equal yields m1 x plus b1 equals m2 x plus b2, which rearranges to x equals b2 minus b1 over m1 minus m2, after which y follows from either line equation.
Standard form writes a x plus b y plus c equals zero and is preferred when a line is vertical or when coefficients arrive from a general linear constraint; the unique solution is obtained by Cramer rule on the system a1 x plus b1 y equals negative c1 and a2 x plus b2 y equals negative c2, with determinant D equals a1 b2 minus a2 b1.
This calculator returns the form used, the two lines with coefficient fields and a short equation string, the intersection as both flat x and y fields and a point object, flags parallel false coincident false unique true on success, and for standard form the determinant used in the solve. The contract is intentionally strict. If you need only the slope of one line through two points, use the dedicated slope tool; the search intent here is specifically the meeting point of two full line equations or an honest error.
Where two-line intersection solving fits in study, design, and code
Students meet simultaneous linear equations early when systems of two variables are introduced. A textbook may give two slope-intercept lines and ask for the intersection, or present standard form constraints from word problems about cost and quantity; this calculator returns the coordinates in one shot with the equations restated for audit. Teachers can pre-generate answer keys that list x and y for mixed form pairs, and refuse parallel and coincident inputs instead of printing a blank or a silent Infinity.
Architects, surveyors, and game-level designers often need where two walls, roads, or path segments would meet if extended as infinite lines; converting coefficient pairs into a point without a hand calculator or a misremembered determinant avoids layout mistakes. Developers call the same contract from scripts to seed deterministic test vectors for geometry libraries, to illustrate linear systems in teaching tools, or to satisfy programming-challenge statements that demand exact two-line intersections.
Pair it with the slope calculator when you first need m from two points and then the intersection of the fitted lines, with unit converters when coordinates arrive in mixed units, and with graphing notes that show students the two lines and the marked crossing so the numbers and the figure stay aligned.
What you can do with it
Layouts, maps, and path crossings
Convert wall, road, or waypoint line equations into the coordinate where the infinite lines would meet for CAD sketches and game geometry.
FAQ
What does the line intersection calculator cost?
It is free in your browser on this page.
Which equation forms are supported?
Set form or let the engine infer it from the fields you send.
How is the intersection calculated?
For slope-intercept, x = (b2 − b1) / (m1 − m2) and y = m1 x + b1. For standard form, D = a1 b2 − a2 b1, x = (b1 c2 − b2 c1) / D, y = (c1 a2 − c2 a1) / D.
What happens if the lines are parallel?
When slopes are equal (slope-intercept) or the coefficient determinant is zero without full proportionality (standard), there is no unique intersection.
What if the two equations describe the same line?
Coincident lines have infinitely many points in common.
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-intersection \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"form":"slope_intercept","format":"slope_intercept"}'const res = await fetch("https://api.kit.forhosting.com/geom/line-intersection", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"form": "slope_intercept",
"format": "slope_intercept"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geom/line-intersection",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"form": "slope_intercept",
"format": "slope_intercept"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geom/line-intersection", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"form":"slope_intercept","format":"slope_intercept"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"form":"slope_intercept","format":"slope_intercept"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geom/line-intersection", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"form": "slope_intercept",
"format": "slope_intercept"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geom.line_intersection",
"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
What line intersection means and what the response contains
Missing coefficients, non-finite values, degenerate zero rows, parallel pairs, and coincident pairs all raise invalid_input with a message that names the failing condition.
How coefficients are read and how the intersection is computed
When form is omitted the engine infers slope intercept if m fields are present and standard if a or c fields are present, and rejects an ambiguous mix unless form is set explicitly. Computation is elementary. In slope intercept, if m1 equals m2 within a tiny relative epsilon the lines are parallel or coincident depending on whether the intercepts match; otherwise x is b2 minus b1 over m1 minus m2 and y is m1 times x plus b1. In standard form a vanishing a and b pair is rejected as a degenerate non-line, a near-zero determinant with proportional coefficients is coincident, a near-zero determinant without full proportionality is parallel, and otherwise x and y follow from the signed two-by-two determinants over D. There is no third line, no least-squares fit, and no unit conversion of the coordinates themselves; the arithmetic assumes a shared Cartesian frame. Optional form may be slope_intercept or standard; aliases format and mode are accepted. For slope intercept the preferred fields are m1, b1, m2, and b2 as JSON numbers, with decimal strings accepted for form and spreadsheet callers. Aliases slope1 and m_1 map to m1; intercept1, y_intercept1, and b_1 map to b1; slope2 and m_2 map to m2; intercept2, y_intercept2, and b_2 map to b2. For standard form the fields are a1, b1, c1, a2, b2, and c2 with a_1, b_1, c_1, a_2, b_2, and c_2 aliases. Pair the free browser run on this page with the priced API when you need the identical mathematical result inside an automated pipeline without re-implementing Cramer rule yourself.
Where two-line intersection solving fits in study, design, and code
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split—free interactive exploration and a priced, identical API—matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result.
Integration use cases
Homework and exam preparation
Solve textbook systems of two linear equations in slope-intercept or standard form, check the unique intersection point, and confirm that parallel inputs fail with invalid_input.
Deterministic geometry fixtures
Generate reproducible intersection points for unit tests, contest validators, and CI assertions without hand-rolled Cramer arithmetic.