Systems of equations solver
Find the one point where two straight lines meet: the lines 2x + y equals 5 and x − y equals 1 cross at (2, 1), worked out with Cramer's rule from three determinants. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A1
- 2
- B1
- 1
- C1
- 5
- A2
- 1
- B2
- -1
- C2
- 1
- X
- 2
- Y
- 1
- Determinant
- -3
- Det x
- -6
A system of two linear equations asks for the single point (x, y) where two straight lines in the plane meet. Write the first line as a1 x plus b1 y equals c1 and the second as a2 x plus b2 y equals c2, then send those six finite coefficients. This systems of equations calculator applies Cramer's rule: the coefficient determinant D is a1 times b2 minus b1 times a2, Dx replaces the x-column with the constants, Dy replaces the y-column, and the unique solution is x equals Dx over D and y equals Dy over D whenever D is not zero.
What a two-equation system is and when a unique (x, y) exists
A linear equation in two unknowns describes a straight line. Two such equations together are a system of equations: every pair (x, y) that satisfies both identities at once is a solution of the system. Graphically that is the intersection of the two lines.
When the lines have different slopes they cross at exactly one point, and that point is the unique solution this calculator returns. When the lines have the same slope they never meet as distinct lines, or they lie on top of each other as the same line. In both of those parallel cases the coefficient determinant a1 b2 minus b1 a2 is zero, and a unique pair does not exist.
Classrooms often first meet this geometry with graphing, then with elimination or substitution, and later with Cramer's rule, which is the closed form used here: replace the first column of the coefficient matrix with the right-hand sides to get Dx, replace the second column to get Dy, and divide each minor by the determinant. The algebraic outcome is identical to elimination and to substitution; only the written steps differ.
This landing is for the generic search “systems of equations”: you already have the six numbers from a worksheet, a lab notebook, or a two-unknown model, and you want the unique x and y without choosing a named method. If you specifically need a substitution write-up or a 3×3 Cramer tableau, use the dedicated pages for those queries.
Where a systems of equations calculator earns its keep
Algebra classrooms and tutoring platforms use a systems of equations calculator so learners can check the intersection of two lines without losing a sign in elimination or isolating the wrong variable. Exam-prep generators need a deterministic oracle that marks parallel coefficients as no unique solution instead of silently returning an empty pair that a buggy grader might treat as success.
Two-unknown models appear far outside the classroom: supply and demand in a simple market, mixture problems with two ingredients, Kirchhoff loops reduced to two currents, and break-even points that set cost equal to revenue on a pair of linear forecasts. Failed validation does not consume balance. Keep all six values finite, treat a zero determinant as a hard error, pin the rounded x and y in tests, and you get reproducible intersections for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own.
Pair this page with a single-equation linear solver when you only have one unknown, and with a 3×3 solver when a third variable appears.
What you can do with it
Classroom and homework checks
Let students submit the six coefficients of two linear equations and verify the unique (x, y), or see a clear parallel-lines error when the determinant is zero.
Exam and LMS auto-grading
Mark two-unknown items with a deterministic oracle that rejects parallel systems as no unique solution and never invents an intersection point.
Two-unknown models in notebooks
Resolve supply-demand, mixture, or two-loop circuit systems from six measured coefficients without importing a computer-algebra library.
FAQ
How do I solve a system of two linear equations for x and y?
Send finite numbers a1, b1, c1 for the first equation and a2, b2, c2 for the second.
Which form of the equations should I use?
Use standard form a1 x + b1 y = c1 and a2 x + b2 y = c2. Rearrange slope-intercept or point-slope equations into that six-coefficient layout before you call the solver.
Does this solve three-equation systems?
No. This landing is the two-unknown systems of equations calculator. For three variables use a dedicated 3×3 solver; the contract here is exactly six coefficients and a unique (x, y).
How does Cramer's rule find x and y?
It divides two determinants by the main one. For 2x + y equals 5 and x − y equals 1 the main determinant is −3, the one for x is −6 and the one for y is −3, so x is 2 and y is 1.
What if the two lines are parallel?
Then the main determinant is zero and there is no single crossing point: the lines either never meet or are the same line. The calculator says so plainly instead of making up a point.
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/systems-of-equations \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}'const res = await fetch("https://api.kit.forhosting.com/math/systems-of-equations", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/systems-of-equations",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/systems-of-equations", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/systems-of-equations", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.systems_of_equations",
"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
When D is zero the lines are parallel or coincident, so there is no unique intersection and the task fails with invalid_input instead of inventing a point. Successful API calls are billed at $0.002; validation failures are not billed.
What a two-equation system is and when a unique (x, y) exists
Here the contract is smaller and stricter: unique solution or a typed error. That matches how many graders and scripts treat a pair of lines—they want one point, or a clear failure they can show to a student as “the lines are parallel.”
Input contract, Cramer's rule, and how parallel lines fail
The engine then forms three 2×2 determinants: D equals a1 b2 minus b1 a2, Dx equals c1 b2 minus b1 c2, and Dy equals a1 c2 minus c1 a2. The capability does not invent a representative point and does not return a success object with a status flag: no unique solution is a client error, not a billed success. When D is safely nonzero, x equals Dx over D and y equals Dy over D. Numbers are rounded to twelve decimal places so goldens stay stable across runtimes. POST a JSON body with six required finite numbers: a1, b1, and c1 for the first equation a1 x plus b1 y equals c1, and a2, b2, and c2 for the second equation a2 x plus b2 y equals c2. Each field may arrive as a JSON number or as a decimal or scientific numeric string. Missing fields, empty strings, booleans, objects, NaN, and infinities fail with invalid_input and a message that names the field. If the absolute value of D is smaller than a tiny numerical epsilon, the lines are treated as parallel and the request is rejected with a message that the system has no unique solution because the lines are parallel. That single error covers both the inconsistent case (two distinct parallel lines, no point in common) and the dependent case (the same line written twice, infinitely many points). The response echoes those two values as the primary result, plus unique true, the three cleaned determinants, two display strings for the original equations, and a formula field restating Cramer's rule. There is no clock, no randomness, and no network: the same six coefficients always produce the same JSON.
Where a systems of equations calculator earns its keep
Calling a tiny parse API avoids pulling a full computer-algebra system for six coefficients.
Technical questions
What happens if the lines are parallel?
The task fails with invalid_input. A zero coefficient determinant means the lines are parallel or coincident, so there is no unique solution and the request is not billed.
What does the systems of equations solver cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.