Slope Calculator (Two Points)

Find the slope, y-intercept, equation and angle of the line through two points — with the line drawn, plus the distance, midpoint and perpendicular slope.

The line

Equation:  y = 2x
Slope (m):  2
Y-intercept (b):  0
Angle:  63.434949°
Rise (y₂ − y₁):  4
Run (x₂ − x₁):  2
Distance between the points:  4.472136
Midpoint:  (1, 2)
Parallel slope:  2
Perpendicular slope:  -0.5

🔒 Calculated instantly in your browser — nothing is uploaded.

The line through two points, drawn

Type the two coordinates and the tool gives the slope, the y-intercept, the equation in y = mx + b form and the angle the line makes with the horizontal. It also draws the line: both points marked, the midpoint ringed, and the axes shown wherever they fall inside the view. This is a plotting-shaped question, and the picture is where a coordinate typed into the wrong box shows up.

Everything else two points tell you

Underneath are the rise and the run the slope is made of, the straight-line distance between the points, the midpoint, and the slopes of the lines parallel and perpendicular to this one. A horizontal line’s perpendicular is vertical, which has no slope at all — the page says so rather than printing infinity, because those are different claims.

Vertical lines, and empty boxes

When both points share an x the line is vertical: it has no slope and no y-intercept, so the equation is written as x = a number and the angle is 90°. It is still drawn. An empty coordinate box is not read as zero — the page names the box instead, because quietly computing a line through a point you never gave is a wrong answer with no warning attached.

Frequently asked questions

How is slope calculated from two points?

Slope m = (y₂ − y₁) ÷ (x₂ − x₁) — the rise over the run. The y-intercept then follows from b = y₁ − m·x₁, and the equation is y = mx + b. Both the rise and the run are shown separately so the division can be checked.

What is the slope of a perpendicular line?

The negative reciprocal, −1 ÷ m: a line of slope 2 is perpendicular to one of slope −0.5. The exception is a horizontal line, whose perpendicular is vertical and has no slope — the page says that in words rather than printing a number that would be wrong.

Why does a vertical line have no slope?

Because the run is zero and you cannot divide by it. The line still exists and is still drawn; it is written as x = a number, and its angle of inclination is 90°.

Does it give the distance and midpoint too?

Yes, both. The distance is √((x₂ − x₁)² + (y₂ − y₁)²) and the midpoint is the average of the two coordinates, ringed on the graph so it is clear which point it is.

Is anything uploaded?

No. The calculation and the drawing both happen in your browser. Nothing you type is sent anywhere or stored.