Slope & Line Equation Solver

Slope, all three forms, intercepts, parallels and perpendiculars from two points — handling vertical lines properly instead of printing infinity.

The line, three ways

Where it crosses, and what is near it

A second line

What the slope formula cannot tell you

  • A vertical line has NO slope. Not zero — that is horizontal — and not infinity. The slope formula divides by the change in x, and for a vertical line that change is exactly zero, so there is no number to give. This tool says "no slope" and still hands you the equation, because x = 4 is a perfectly good line.
  • The perpendicular rule you were taught, m1 x m2 = -1, cannot handle the most obvious right angle there is. A vertical line and a horizontal line plainly meet at ninety degrees, but one of them has no slope, so there is no product to take. The rule is incomplete rather than wrong, and it fails exactly where your intuition is strongest.
  • So nothing here is built on slope. Every line is held as ax + by = c, which describes a vertical line as easily as any other, and parallel and perpendicular are decided from the direction each line points. Slope is reported afterwards as one fact about a line — and reported as absent when it is.
  • Two points that are the same point do not make a line. Infinitely many lines pass through one point, so the tool says so instead of returning whichever one the arithmetic happened to produce.
  • Every answer is checked against the line it came from: both of your points are confirmed to sit on it, the perpendicular really does meet it at a right angle, and the closest point really is on the line. Those are exact identities, so they either hold or the answer is wrong.

How to use

  1. Type the coordinates of two points.
  2. Read the slope, the three forms, and the intercepts.
  3. Add a second line to test parallel, perpendicular, or where they meet.

Frequently asked questions

What is the slope of a vertical line?

It has none. Not zero — that is a horizontal line — and not infinity. The slope formula divides by the change in x, and for a vertical line that change is exactly zero, so there is no number to report. This tool says so and still gives you the equation, because x = 4 is a perfectly good line.

Why does m1 x m2 = -1 not always work?

Because it cannot handle the most obvious right angle there is. A vertical line and a horizontal line plainly meet at ninety degrees, but the vertical one has no slope, so there is no product to take. The rule is incomplete rather than wrong, and it fails exactly where your intuition is strongest.

So how does this decide perpendicular?

From the direction each line points rather than from a ratio that sometimes does not exist. Every line is held as ax + by = c, which describes a vertical line as easily as any other. Where both slopes do exist the two methods agree — checked on 18,073 random pairs without a single disagreement.

What if I enter the same point twice?

You get told, rather than given an answer. Infinitely many lines pass through a single point, so there is no line to report, and returning whichever one the arithmetic happened to produce would be inventing it.

Is the answer checked?

Yes, and the checks are exact identities rather than approximations. Both of your points are confirmed to satisfy the equation, the perpendicular is confirmed to meet the line at a right angle, and the closest point is confirmed to be on the line with the distance matching. Those were swept over 20,000 random cases each before this shipped.

Why is my slope shown as a fraction?

Because two thirds is two thirds. A slope of 0.666667 is a rounded decimal pretending to be exact, so where a simple fraction fits, that is what you get.

🔒 This tool runs entirely in your browser. Nothing you enter is uploaded, logged, or stored.