AZ Tools

Slope & Line Calculator

Everyday

Enter the coordinates of two points and this tool works out everything about the line through them: the slope (m = Δy/Δx), the equation in slope-intercept form (y = mx + b), the angle of inclination in degrees, the straight-line distance between the points, their midpoint, and the rise and run. Vertical lines (where the run is zero) are handled too — the slope is reported as undefined and the equation as x = constant. Great for coordinate-geometry homework, graphing, surveying and any place you need the line between two points. Everything is computed locally in your browser.

Point 1

xy

Point 2

xy
Line equation

y = 2x + 0

Slope (m)

2

Angle

63.43°

Distance

6.7082

Midpoint

(2.5, 5)

Rise (Δy)

6

Run (Δx)

3

How to use

  1. Enter the x and y coordinates of the first point.
  2. Enter the x and y coordinates of the second point.
  3. Read the slope, equation, distance, midpoint, angle and rise/run; copy the equation if you need it.

Frequently asked questions

How is the slope calculated?
Slope m = (y₂ − y₁) / (x₂ − x₁), the change in y divided by the change in x. For example, from (1, 2) to (4, 8) the slope is (8 − 2) / (4 − 1) = 2.
What happens with a vertical line?
If both points share the same x value, the run is zero and the slope is undefined — a vertical line. The equation is shown as x = that value, and the angle is 90°.
What is the angle of inclination?
It's the angle the line makes with the horizontal x-axis, equal to arctan(slope). A slope of 1 is 45°; a horizontal line is 0°.
How is the distance found?
By the distance formula √((x₂ − x₁)² + (y₂ − y₁)²) — the length of the straight segment between the two points.

Related tools