UTILS.
Private by default
📈

Slope & Line Equation Calculator

Find the slope, y-intercept, line equation, angle, distance and midpoint from two points (x1,y1) and (x2,y2).

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Slope & Line Equation Calculator is a free, in-browser tool that takes two points and returns everything about the straight line through them: the slope, the y-intercept, the full line equation, the angle of incline, the distance between the points and their midpoint. Every value is computed locally as you type — nothing is uploaded.

The slope is m = (y2 − y1) / (x2 − x1), the rise over the run. The y-intercept is b = y1 − m·x1, giving the equation y = m·x + b. The angle of incline is atan(m) converted to degrees, the distance is √((x2 − x1)² + (y2 − y1)²) from the Pythagorean theorem, and the midpoint is ((x1 + x2)/2, (y1 + y2)/2).

If the two x-values are equal the line is vertical: the slope is undefined (division by zero) and the equation collapses to x = x1, which the tool shows instead of a number. Use it for algebra homework, coordinate geometry or plotting — change any coordinate and all six results refresh instantly.

Frequently asked questions

How is the slope calculated?
Slope m is the change in y divided by the change in x: m = (y2 − y1) / (x2 − x1). A positive slope rises left to right, a negative slope falls, and zero means a horizontal line.
Why does it say the slope is undefined?
When x1 equals x2 the run is zero, so the slope formula would divide by zero. That describes a vertical line, whose equation is simply x = x1 — there is no finite slope or y-intercept.
What is the angle of incline?
It is the angle the line makes with the horizontal x-axis, computed as atan(slope) in degrees. A slope of 1 gives 45°, a horizontal line gives 0°, and a vertical line gives 90°.
Is my data sent anywhere?
No. The coordinates and every result are processed entirely in your browser; nothing is uploaded and the tool works offline.

More tools