What the slope of a line actually measures
Slope is the steepness of a straight line: how much it rises or falls for each unit you move to the right. For two points (x₁, y₁) and (x₂, y₂), slope is the change in y divided by the change in x — commonly called rise over run.
The same formula answers graph questions, roof-pitch questions and ramp or drainage problems. Because a straight line has a constant slope, any two points on the line give the same answer, so it does not matter which point you label first as long as you subtract in the same order.
This calculator also returns the angle of inclination, the distance between the points, the midpoint, and the line equation in slope–intercept, point–slope and standard form.
Slope formulas used on this page
← Swipe →| Quantity | Formula | Notes |
|---|---|---|
| Slope | m = (y₂ − y₁) ÷ (x₂ − x₁) | Undefined when x₁ = x₂, because the run is zero. |
| Rise and run | rise = Δy, run = Δx | The vertical and horizontal change between the two points. |
| Slope angle | θ = arctan(m) | Signed: negative for a falling line. The 0–180° angle of inclination adds 180° when m < 0. |
| Distance | d = √((x₂ − x₁)² + (y₂ − y₁)²) | The straight-line distance between the points. |
| Midpoint | M = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) | The point exactly halfway along the segment. |
| Slope–intercept form | y = mx + b | b = y₁ − m·x₁ is the y-intercept. |
| Point–slope form | y − y₁ = m(x − x₁) | Useful when you know the slope and one point on the line. |
| Standard form | Ax + By = C | Integer coefficients whenever both points have integer coordinates. |
Common slopes at a glance
← Swipe →| Slope m | Rise : run | Angle | Typical use |
|---|---|---|---|
| 0 | 0 : 1 | 0° | Level ground, flat roof, horizontal line |
| 0.5 | 1 : 2 | 26.5651° | Gentle ramp or driveway apron |
| 1 | 1 : 1 | 45° | 45° roof pitch, 100% grade |
| 1.5 | 3 : 2 | 56.3099° | Steep driveway or stair stringer |
| 2 | 2 : 1 | 63.4349° | The worked example on this page |
| Undefined | 1 : 0 | 90° | Vertical line or wall |
| −0.5 | −1 : 2 | −26.5651° | Falling from left to right |
Worked calculation examples
Slope between two survey points
A drainage pipe falls from (0, 0) to (12, 1.5), measured in feet.
- 1.rise = 1.5 − 0 = 1.5 ft
- 2.run = 12 − 0 = 12 ft
- 3.m = 1.5 ÷ 12 = 0.125
- 4.angle = arctan(0.125) = 7.1250°
- 5.distance = √(12² + 1.5²) = 12.0934 ft
Reading a line on a graph
A line passes through (−2, 5) and (4, −1), with grid units in centimetres.
- 1.rise = −1 − 5 = −6 cm
- 2.run = 4 − (−2) = 6 cm
- 3.m = −6 ÷ 6 = −1
- 4.midpoint = ((−2 + 4) ÷ 2, (5 + (−1)) ÷ 2) = (1, 2)
- 5.equation: y = −x + 3, which is x + y = 3 in standard form
Slope tips for homework and field work
Label the points before substituting
Write (x₁, y₁) and (x₂, y₂) on the page first. The most common slope mistake is pairing a y-value with the wrong x-value.
Vertical lines are a special case
When x₁ = x₂ the run is zero, so division is not defined. Report an undefined slope and write the line as x = a constant.
Convert slope to grade
Multiply slope by 100 for a percentage grade: 0.05 = 5%. Multiply by 1,000 for millimetres per metre: 0.05 = 50 mm/m.
Check the sign against the drawing
Rising to the right is positive, falling to the right is negative, and a flat line is zero. If the sign disagrees with your sketch, recheck the subtraction order.
Keep the fraction when you can
Rise over run as a reduced fraction is easy to verify on graph paper. The decimal is a convenience, not the definition.
Frequently asked questions
What is slope?+
Slope is the change in y divided by the change in x between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). A slope of 1 rises one unit for every unit you move right.
What does an undefined slope mean?+
It means the line is vertical: both points share the same x-value, so the run is zero and the division is undefined. A vertical line is written as x = a.
How do I convert slope to degrees?+
Use θ = arctan(m) and convert the result from radians to degrees. A slope of 1 is exactly 45°, a slope of 0.5 is about 26.5651°, and a vertical line is 90°.
How do I find the equation of a line from two points?+
Compute the slope first, then the y-intercept b = y₁ − m·x₁. The line is y = mx + b. This calculator also shows point–slope form y − y₁ = m(x − x₁) and standard form Ax + By = C.
Does the unit system change the slope?+
No. Slope is a ratio of two lengths, so the units cancel. The same line has the same slope in feet, metres or grid squares; only the coordinates and distance carry a unit label.
What is the difference between slope and midpoint?+
Slope describes the direction and steepness of the whole line. The midpoint is a single point halfway between the two endpoints. This page calculates both from the same pair of coordinates.