Intersection of Two Lines Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 12/6/2026

Two lines y = m1x + b1 and y = m2x + b2 meet at x = (b2 − b1) / (m1 − m2), then y = m1x + b1. For y = 2x + 1 and y = −x + 7, x = 2 and y = 5: the intersection point is (2, 5).

Explanation

Finding where two lines cross means solving a small system of two equations with two unknowns. If the lines are written as y = m × x + b, where m is the slope (how much y rises when x increases by 1) and b the y-intercept (the value of y when x is 0), the common point must satisfy both equations at once. So set the two expressions of y equal: m1 × x + b1 = m2 × x + b2, which gives (m1 − m2) × x = b2 − b1, then x = (b2 − b1) / (m1 − m2). Plugging x into either equation gives y. This division is only possible if the slopes differ. If m1 = m2, the lines have the same direction: either they are parallel and distinct, when the intercepts differ, and share no point; or they coincide, when the intercepts are equal, and share infinitely many points. The calculator tells the three cases apart. It also gives the acute angle between the lines, from tan θ = |(m2 − m1) / (1 + m1 × m2)|; when the product of the slopes is −1, the lines are perpendicular and the angle is 90°. A vertical line, x = k, has no slope and cannot be entered in this form. This tool serves analytic geometry, but also economics, to find the equilibrium between linear supply and demand, or physics, to know when two objects moving at constant speed meet. If you start from two points rather than an equation, first get the line with the line through two points calculator, then come back here. To measure the distance from a point to a line, use the point-to-line distance calculator.

Example: y = 2x + 1 and y = −x + 7

Inputs

Slope 2 and intercept 1 for the first line; slope −1 and intercept 7 for the second.

Calculation

x = (7 − 1) / (2 − (−1)) = 6 / 3 = 2. y = 2 × 2 + 1 = 5. Check in the second: −2 + 7 = 5. Angle: arctan |(−1 − 2) / (1 + 2 × (−1))| = arctan 3 ≈ 71.57°.

Result

The lines meet at (2, 5), forming an acute angle of about 71.57°.

Frequently asked questions

What if both slopes are equal?

The lines do not meet at a single point. If the intercepts differ, they are parallel and never meet; if they are equal, the lines coincide. The calculator says which.

How can I check the result?

Substitute the coordinates found into both equations: they must give the same y. That is the best check.

How do I handle a vertical line?

A line x = k meets any line y = m × x + b at the point (k, m × k + b). Just replace x with k in the other line’s equation.

Related resources

Similar calculators