Line Intersection Calculator
Each line is defined by two points, which fixes its direction and position.
Enter Values
How to use this calculator
- Enter the x and y coordinates of two points on the first line (A and B).
- Enter the x and y coordinates of two points on the second line (C and D).
- Read the intersection point (x, y); if the lines are parallel or the same line, the result says so instead.
How it works
Each line is defined by two points, which fixes its direction and position. The calculator treats both lines as infinite (not just the segments between your points) and solves them simultaneously using the standard two-line determinant method, so it works for any orientation — including vertical lines, which slope-intercept formulas cannot handle.
The shared denominator is d = (x₁−x₂)(y₃−y₄) − (y₁−y₂)(x₃−x₄). When d is not zero, the intersection is x = [(x₁y₂−y₁x₂)(x₃−x₄) − (x₁−x₂)(x₃y₄−y₃x₄)] ÷ d and y = [(x₁y₂−y₁x₂)(y₃−y₄) − (y₁−y₂)(x₃y₄−y₃x₄)] ÷ d. If d = 0 the lines are parallel; a collinearity check on point C then tells you whether they are distinct parallels (never meet) or the same line (meet everywhere).
Worked example
Where do the two diagonals of a square cross?. Line 1 runs from A (0, 0) to B (4, 4); Line 2 runs from C (0, 4) to D (4, 0). Enter the eight coordinates. The determinant d = (0−4)(4−0) − (0−4)(0−4) = −16 − 16 = −32, which is non-zero, so the lines cross. The calculator returns Intersection x = 2, Intersection y = 2 — the point (2, 2) at the centre of the square, exactly as expected for two diagonals.
Common mistakes
- Entering the same point twice for one line (A = B). A single point has no direction, so the line is undefined — give two different points per line.
- Assuming the answer must lie between your points. This tool intersects the full infinite lines; the crossing can fall outside both point pairs, which is correct for lines but not for finite segments.
- Expecting a point when the lines are parallel. If the two lines have the same slope the result is 'Parallel — no intersection' (or 'Coincident' when they are the same line), not a coordinate.
Frequently asked questions
What if the two lines are parallel?
Parallel lines never cross, so there is no single intersection point. The calculator detects this (the determinant d equals zero) and reports 'Parallel — no intersection point' instead of returning a coordinate.
What does 'coincident' mean in the result?
It means the two lines lie exactly on top of one another — same slope and same position — so they share every point. There are infinitely many intersection points rather than one, so no single (x, y) is returned.
Does this work for vertical lines?
Yes. Because it uses the two-point determinant method rather than y = mx + b, it handles vertical lines (undefined slope) and every other orientation without special cases.
Related tools
- Slope Calculator
- Slope Intercept Form Calculator
- Midpoint Calculator
- Circle Equation Calculator
- Angle Sum Calculator
- Rule of Three Calculator
Explore more in Maths, Education & Science.
Tip: Enter any known values to calculate the remaining results.
All calculations run in your browser. Your inputs are never saved or transmitted.



