Skip to content
GeoCalcLab emblem
GeoCalcLab.com

Slope Calculator: Rise, Run, Angle & Line Equation

Enter two points to get slope m, angle of inclination, distance, midpoint, and the line equation — with every substitution shown.

FreeNo sign-upMetric + imperialStep-by-step formula
Unit
Try:

Same answer, other units: distance = 2.0447 m · midpoint = (0.762, 1.524) m

Slope m
2
Distance
6.7082 ft

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 →
QuantityFormulaNotes
Slopem = (y₂ − y₁) ÷ (x₂ − x₁)Undefined when x₁ = x₂, because the run is zero.
Rise and runrise = Δy, run = ΔxThe 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.
Distanced = √((x₂ − x₁)² + (y₂ − y₁)²)The straight-line distance between the points.
MidpointM = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)The point exactly halfway along the segment.
Slope–intercept formy = mx + bb = y₁ − m·x₁ is the y-intercept.
Point–slope formy − y₁ = m(x − x₁)Useful when you know the slope and one point on the line.
Standard formAx + By = CInteger coefficients whenever both points have integer coordinates.

Common slopes at a glance

← Swipe →
Slope mRise : runAngleTypical use
00 : 10°Level ground, flat roof, horizontal line
0.51 : 226.5651°Gentle ramp or driveway apron
11 : 145°45° roof pitch, 100% grade
1.53 : 256.3099°Steep driveway or stair stringer
22 : 163.4349°The worked example on this page
Undefined1 : 090°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. 1.rise = 1.5 − 0 = 1.5 ft
  2. 2.run = 12 − 0 = 12 ft
  3. 3.m = 1.5 ÷ 12 = 0.125
  4. 4.angle = arctan(0.125) = 7.1250°
  5. 5.distance = √(12² + 1.5²) = 12.0934 ft
Takeaway: A slope of 0.125 is a 12.5% grade, or about 1:8. That is steeper than the 1:12 that accessibility guidance commonly recommends for ramps, so check local requirements before building.

Reading a line on a graph

A line passes through (−2, 5) and (4, −1), with grid units in centimetres.

  1. 1.rise = −1 − 5 = −6 cm
  2. 2.run = 4 − (−2) = 6 cm
  3. 3.m = −6 ÷ 6 = −1
  4. 4.midpoint = ((−2 + 4) ÷ 2, (5 + (−1)) ÷ 2) = (1, 2)
  5. 5.equation: y = −x + 3, which is x + y = 3 in standard form
Takeaway: A negative slope falls from left to right. Swapping which point is first flips both the rise and the run, so the slope value stays the same.

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.