Audited 31 Jul 2026·Last updated 28 Oct 2026·4 citations·Tier 2·0 uses

Intersection of Two Lines Calculator

Find the point where two lines cross from y = mx + c or Ax + By = C, with the angle between them and a check, or learn if they are parallel or identical.

Intersection of Two Lines Calculator

How are your lines written?
Used only in slope-intercept mode. Any real number; a slope of 0 is a horizontal line.
Where line 1 crosses the y-axis. Used only in slope-intercept mode.
If this equals m₁ the lines are parallel and there is no single crossing point — the calculator says which of the two parallel cases you have.
Where line 2 crosses the y-axis. Used only in slope-intercept mode.
Coefficient of x in A·x + B·y = C. Used only in standard mode. A and B cannot both be zero.
Coefficient of y. Set this to 0 for a vertical line such as x = 3.
The right-hand side of line 1's equation. Used only in standard mode.
Coefficient of x in line 2. Used only in standard mode.
Coefficient of y in line 2. Set to 0 for a vertical line.
The right-hand side of line 2's equation. Used only in standard mode.
They cross at
(2, 5)
The point (x, y) that lies on both lines; parallel or identical lines produce a message instead.
x
2
y
5
Angle between the lines
71.5651°
Perpendicular
0
Determinant A₁B₂ − A₂B₁
-3
Check: A₁x + B₁y
-1
Check: A₂x + B₂y
-7

Background.

The point where two straight lines cross is the one pair of values that satisfies both equations at once, and a surprising number of practical questions come down to finding it. Two pricing plans, one charging 20 plus 2 per unit and the other 50 plus 0.5 per unit, cost the same where y = 2x + 20 meets y = 0.5x + 50: at 20 units, when both come to 60. Break-even charts, supply and demand lines, and the corners of a linear-programming region are all the same calculation.

Two lines in a plane can do only three things. They cross once, they run parallel and never meet, or they are the same line written two ways. The calculator tells you which, and in the last two cases it says so in words rather than returning a number, because no solution and infinitely many solutions are different answers. Textbooks call those systems inconsistent and dependent.

Lines can be entered as y = mx + c or as Ax + By = C. Slope-intercept form is the one most algebra courses use, but it cannot describe a vertical line such as x = 3, which has no slope; standard form handles it by setting B to zero. Slope-intercept entries are rewritten internally as mx − y = −c, so both forms run through the same solver and agree for any line both can express.

What is intersection of two lines calculator?

The intersection of two lines is the set of points lying on both. Since a point lies on a line exactly when its coordinates satisfy the line's equation, finding the intersection is the same as solving a system of two linear equations in two unknowns. Writing both lines as A₁x + B₁y = C₁ and A₂x + B₂y = C₂, a single crossing exists precisely when the determinant A₁B₂ − A₂B₁ is not zero. When it is zero the lines point in the same direction, and they are either parallel and distinct, with no common point, or the same line, with every point in common.

How to use this calculator.

  1. Choose the form your equations are in. Use standard form if either line is vertical.
  2. In slope-intercept mode, enter each line's slope m and y-intercept c. The standard-form fields are ignored.
  3. In standard mode, enter A, B and C for each line after moving every x and y term to the left: 3y = 6 − 2x becomes 2x + 3y = 6. A vertical line x = 3 is A = 1, B = 0, C = 3; a horizontal line y = −2 is A = 0, B = 1, C = −2.
  4. Read the crossing point, or the message saying the lines are parallel or identical.
  5. Confirm the answer with the two check values, which should equal C₁ and C₂. In slope-intercept mode those are −c₁ and −c₂, because of the internal rewrite.

The formula.

x = (C₁B₂ − C₂B₁) ⁄ D · y = (A₁C₂ − A₂C₁) ⁄ D · D = A₁B₂ − A₂B₁ · cos θ = |A₁A₂ + B₁B₂| ⁄ (‖n₁‖‖n₂‖)

The solver uses Cramer's rule. With D = A₁B₂ − A₂B₁, the coordinates are x = (C₁B₂ − C₂B₁) ÷ D and y = (A₁C₂ − A₂C₁) ÷ D, the elimination method written as determinants. When D = 0 the normal vectors (A₁, B₁) and (A₂, B₂) are parallel, so the lines are too. If the two numerators are also zero, one equation is a multiple of the other and they describe the same line; otherwise the lines never meet. The angle comes from the normals: cos θ = |A₁A₂ + B₁B₂| ÷ (√(A₁² + B₁²) × √(A₂² + B₂²)). The absolute value makes θ the acute angle, between 0° and 90°, whichever way round each equation is written. The more familiar slope formula, tan θ = |(m₂ − m₁) ÷ (1 + m₁m₂)|, divides by zero for perpendicular lines and has nothing to work with when a line is vertical; the normal-vector version has neither gap. Perpendicularity is the exact test A₁A₂ + B₁B₂ = 0, which is the same as m₁m₂ = −1 when both slopes exist. The size of D depends on how each equation happens to be scaled, so only whether it is zero carries geometric meaning.

A worked example.

Example

Find where y = 2x + 1 and y = −x + 7 cross. Rewritten in standard form they are 2x − y = −1 and −x − y = −7, so A₁ = 2, B₁ = −1, C₁ = −1 and A₂ = −1, B₂ = −1, C₂ = −7. The determinant is D = 2 × (−1) − (−1) × (−1) = −2 − 1 = −3, which is not zero, so there is one crossing. For x: (C₁B₂ − C₂B₁) = (−1)(−1) − (−7)(−1) = 1 − 7 = −6, and −6 ÷ −3 = 2. For y: (A₁C₂ − A₂C₁) = 2 × (−7) − (−1)(−1) = −14 − 1 = −15, and −15 ÷ −3 = 5. The lines cross at (2, 5). Substituting back, 2(2) − 5 = −1 and −2 − 5 = −7, matching C₁ and C₂. For the angle, the normals (2, −1) and (−1, −1) have a dot product of −2 + 1 = −1 and lengths √5 and √2, so cos θ = 1 ÷ √10 = 0.3162 and θ = 71.5651°. The slope formula agrees: |(−1 − 2) ÷ (1 − 2)| = 3, and arctan 3 = 71.5651°.

intercept11
const C27
formslope-intercept
slope2-1
coef A21
slope12
coef A12
coef B21
coef B1-1
const C1-1
intercept27

Frequently asked questions.

How do I enter a vertical line such as x = 3?
Switch to standard form and enter A = 1, B = 0, C = 3. Slope-intercept form cannot express it because a vertical line has no slope. Against 2x − y = −1, that is the line y = 2x + 1, the crossing is (3, 7) and the acute angle between the lines is 26.5651°.
What happens if the lines are parallel, or are the same line?
Parallel lines, such as y = 2x + 1 and y = 2x + 4, never meet, and the calculator says so instead of giving a point. Identical lines share every point; it recognises them even in disguise, so 2x − y = −1 and 4x − 2y = −2, the second being the first doubled, are reported as the same line.
Why do the check values show −1 and −7 instead of my intercepts?
In slope-intercept mode each line y = mx + c is rewritten as mx − y = −c, and the checks evaluate the left-hand side of that rewritten form. A correct answer therefore reproduces −c₁ and −c₂: here −1 and −7. In standard mode the checks reproduce C₁ and C₂ exactly as you typed them.
Why did the determinant change when I rewrote one equation?
Because it is calculated from the coefficients as entered, and multiplying an equation through by a number changes them without changing the line. Writing 2x − y = −1 as 20x − 10y = −10 alongside x + y = 7 raises the determinant from 3 to 30, while the crossing point stays at (2, 5).
My lines should be perpendicular, so why does the flag read 0?
The test is exact. With slopes 3 and −0.3333, the product is −0.9999, not −1, so the angle is 89.9983° and the flag stays at 0. Enter the second line in standard form to keep the fraction exact: y = −x/3 + 7 becomes x + 3y = 21, and against 3x − y = −1 the angle is exactly 90°.
Why does the crossing point jump around when the lines are nearly parallel?
When the slopes are close, a tiny change moves the crossing a long way. The lines y = x and y = 1.001x + 1 meet at (−1000, −1000), only 0.0286° apart; change the second slope to 1.002 and they meet at (−500, −500). With measured data, a crossing of nearly parallel lines is very uncertain.

How this page was produced

Published by
Quanta Calculator
Primary sources
4 cited below
Method
x = (C₁B₂ − C₂B₁) ⁄ D · y = (A₁C₂ − A₂C₁) ⁄ D · D = A₁B₂ − A₂B₁ · cos θ = |A₁A₂ + B₁B₂| ⁄ (‖n₁‖‖n₂‖)
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon