Slope Calculator
Slope, Distance & Midpoint Tool
Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
Understanding Slope, Distance & Midpoint
Two points on a coordinate plane are all you need to describe a line completely — its steepness, its equation, how far apart the points are, and the point exactly between them.
Slope is the ratio of vertical change to horizontal change between two points. It tells you exactly how steep a line is and in which direction it travels.
The distance formula is just the Pythagorean theorem in disguise, and the midpoint is simply the average of the two points — both are useful well beyond graphing lines, from geometry to physics.
The Core Formulas
Slope
Distance
Midpoint
Reading the Slope
A positive slope climbs from left to right, a negative slope descends, and a slope of exactly zero is a flat horizontal line. A vertical line is the one exception — its "run" is zero, so the slope formula divides by zero and the slope is undefined. In that special case, the line is instead described by x = constant.
The line rises as you move from left to right.
A perfectly flat, horizontal line.
A perfectly vertical line — no y = mx + b form exists.
Key Takeaways
- Slope is "rise over run," the ratio of vertical change to horizontal change between two points.
- A vertical line has an undefined slope, even though its distance and midpoint are still perfectly well-defined.
-
Once you know the slope, the y-intercept follows directly by substituting either known point into
y = mx + b.
Frequently Asked Questions
- Enter the coordinates of the first point,
(x₁, y₁). - Enter the coordinates of the second point,
(x₂, y₂). - Click "Calculate" to see the slope, the slope-intercept equation of the line, the distance between the points, and their midpoint.
Slope measures how steep a line is — how much y changes for every unit change in x. It's calculated as "rise over run": m = (y₂ − y₁) / (x₂ − x₁). A positive slope rises left to right, a negative slope falls, a slope of zero is a flat horizontal line, and a vertical line has no defined slope.
Slope-intercept form, y = mx + b, describes a line using its slope m and its y-intercept b (the point where the line crosses the y-axis). Once you know the slope, you can find b by substituting either known point back into the equation.
When both points share the same x-coordinate (x₁ = x₂), the "run" in the slope formula becomes zero, and dividing by zero is undefined. Graphically, the line is perfectly vertical — it doesn't fit the y = mx + b form at all, and is instead described by the equation x = constant. The distance and midpoint between the two points are still perfectly well-defined in this case.
Distance uses the Pythagorean theorem applied to the horizontal and vertical gaps between the points: d = √((x₂−x₁)² + (y₂−y₁)²). The midpoint is simply the average of the two x-coordinates and the average of the two y-coordinates: ((x₁+x₂)/2, (y₁+y₂)/2).
A slope of zero means y never changes as x increases — the line is perfectly horizontal. This is the opposite case from a vertical line: a horizontal line has a well-defined (zero) slope, while a vertical line's slope is undefined.