Slope, line equation and distance between two points.
Results are estimates for planning purposes and are not financial, medical, or professional advice.
How to Use the Slope Calculator
The slope of a line measures its steepness and direction. Enter any two points and this calculator finds the slope, the line equation, and the distance between them.
- Enter the first point (x1, y1).
- Enter the second point (x2, y2).
- Click Calculate for the slope as a fraction and a decimal.
- Read the line equation in slope-intercept form.
Slope Calculator Formula
Slope, written as m, is the change in y divided by the change in x: m equals (y2 minus y1) divided by (x2 minus x1), often remembered as rise over run. The line equation comes from point-slope form – y minus y1 equals m times (x minus x1) – rearranged into y equals m x plus b. The distance between the points is the square root of ((x2 minus x1) squared plus (y2 minus y1) squared), the Pythagorean theorem applied to the two gaps. Subtract in the same order top and bottom: (y2 minus y1) over (x1 minus x2) gives the negative of the true slope.
The Four Types of Slope
Every line is one of four cases. A positive slope rises left to right; a negative slope falls. A zero slope is a flat horizontal line. An undefined slope is a vertical line – both x-values match, the run is zero, and division by zero has no answer, so the line is written as x equals a constant.
Example Calculation
Take the points (2, 3) and (8, 15). The rise is 12, the run is 6, so the slope is 2; point-slope form at (2, 3) simplifies to y equals 2x minus 1, and the distance is the square root of (36 plus 144), about 13.42. A gentler case: (1, 2) and (4, 6) give a slope of 4/3, about 1.33, and a distance of exactly 5.


Slope as Percent Grade and Angle
Outside the classroom, slope is reported two other ways. Percent grade is slope times 100: a slope of 0.06 reads as a 6 percent grade. The angle of inclination is the arctangent of the slope, so a slope of 1 is a 45 degree climb and a slope of 2 is about 63.43 degrees. The scales differ: grades can pass 100 percent, while an angle stops at 90 degrees.
Frequently Asked Questions
What does the slope actually tell me?
How fast y changes as x grows: a slope of 2 means y rises 2 units for every 1 unit right, and larger slopes mean steeper lines.
What is the difference between zero slope and undefined slope?
Zero slope is a horizontal line like y equals 5; undefined slope is a vertical line like x equals 3, where the run is zero.
How do I write the equation of a line from two points?
Compute the slope, plug it and one point into point-slope form, then solve for y. The calculator does all three steps for you.
What does a negative slope mean?
The line falls from left to right. In a distance-time graph, for example, it would mean moving back toward the start.
How are parallel and perpendicular slopes related?
Parallel lines share their slope. Perpendicular slopes are negative reciprocals: if one slope is 2, the perpendicular slope is negative one-half.
How do I convert slope to a percent grade or an angle?
Multiply the slope by 100: a slope of 2 is a 200 percent grade. The angle is the arctangent of the slope – about 63.43 degrees here. Note that a 100 percent grade is 45 degrees, not vertical.
Does the order of the two points matter?
No: swapping the points flips the sign of both rise and run, and the negatives cancel. Just subtract in the same order top and bottom: (y2 minus y1) over (x2 minus x1).
Related Calculators
Try our Pythagorean Theorem Calculator and Scientific Calculator for more math tools.