100+ free calculators - no signup, no ads | 💰 Financial ❤️ Health & Fitness 📐 Math 🔧 Other
🇺🇸 USD | About Contact

Slope Calculator

Two points · Line equation · Point at a distance · Angle and grade

m = (y₂ − y₁) ÷ (x₂ − x₁)
Point 1
Point 2

📈 Enter two points, a point and a slope, or an angle to see the slope, line equation, and graph.

What Is Slope?

Slope measures how steep a line is and which way it tilts. It is the ratio of the vertical change, the rise, to the horizontal change, the run, between any two points on the line. A slope of 2 means the line climbs 2 units for every 1 unit it moves right.

A positive slope rises from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has an undefined slope because its run is 0. The larger the absolute value, the steeper the line. Slope is the m in y = mx + b and also describes rates of change such as speed, price per unit, or road steepness.

How to Use the Slope Calculator

  1. Two points: enter (x₁, y₁) and (x₂, y₂). You get the slope as a fraction and a decimal, the angle, percent grade, distance, midpoint, and the line equation in slope intercept, point slope, and standard form.
  2. Point + slope: enter one point, the steepness as a slope, angle, or grade, and a distance. You get the two points that lie that far away along the line, plus its equation.
  3. Angle and grade: convert between degrees, percent grade, slope, rise to run ratio, and roof pitch.

Decimals and negative values are accepted everywhere. The graph uses equal scales on both axes, so the drawn angle matches the true angle.

Slope Formula with a Worked Example

m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run Points (1, 2) and (5, 8) rise = 8 − 2 = 6; run = 5 − 1 = 4 m = 6 ÷ 4 = 3/2 = 1.5

Subtract in the same order on top and bottom. Using (y₁ − y₂) ÷ (x₁ − x₂) gives the same answer, but mixing the orders flips the sign.

Distance = √(run² + rise²) √(4² + 6²) = √52 = 2√13 ≈ 7.2111 Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) ((1 + 5) ÷ 2, (2 + 8) ÷ 2) = (3, 5)

Equation of a Line from Two Points

Point slope: y − y₁ = m(x − x₁) y − 2 = 1.5(x − 1) Slope intercept: y = mx + b b = y₁ − m x₁ = 2 − 1.5 × 1 = 0.5, so y = 1.5x + 0.5 Standard: Ax + By = C Multiply by 2: 2y = 3x + 1, so 3x − 2y = −1

The y intercept is b = 0.5, where the line crosses the y axis. The x intercept is where y = 0: x = −b ÷ m = −1/3. Standard form uses whole number coefficients with A positive.

Slope, Angle, and Percent Grade

The slope equals the tangent of the angle the line makes with the x axis, so m = tan θ and θ = arctan m. Percent grade is the slope times 100: a road that rises 6 m over 100 m of horizontal distance has a 6% grade. A rise to run ratio of 1:12 means 1 unit up for every 12 across.

GradeSlope mAngleRise : run
1%0.010.57°1 : 100
5%0.052.86°1 : 20
8.33%0.08334.76°1 : 12
10%0.15.71°1 : 10
25%0.2514.04°1 : 4
50%0.526.57°1 : 2
100%145°1 : 1

Grade and angle are not proportional. Doubling the grade from 50% to 100% raises the angle from 26.57° to 45°, and a vertical wall has an infinite grade. Roof pitch is usually stated as inches of rise per 12 inches of run, so a 6/12 roof has slope 0.5 and an angle of 26.57°, and a 12/12 roof is 45°.

Parallel and Perpendicular Slopes

Parallel lines have the same slope and never meet. Perpendicular lines meet at a right angle, and their slopes are negative reciprocals: flip the fraction and change the sign. The product of the two slopes is −1.

m⊥ = −1 ÷ m m = 3/2 → m⊥ = −2/3; check: 3/2 × −2/3 = −1

A horizontal line (slope 0) and a vertical line (undefined slope) are also perpendicular, the one case where the product rule cannot be applied.

Finding a Point at a Distance

To move a distance d along a line with slope m from (x₁, y₁), split d into horizontal and vertical parts.

Δx = d ÷ √(1 + m²); Δy = m × Δx m = 0.75, d = 5: √1.5625 = 1.25, Δx = 4, Δy = 3 From (1, 2): (5, 5) forward, (−3, −1) backward

Every line has two directions, so there are always two answers. For a vertical line, move straight up and down: (x₁, y₁ ± d).

Slope as a Rate of Change

Slope carries units: the units of y divided by the units of x. That makes it a rate. A car at 30 km after 0.5 hours and 120 km after 2 hours has a slope of (120 − 30) ÷ (2 − 0.5) = 60 km per hour, its average speed.

The same idea gives cost per item, growth per year, or temperature change per hour. A taxi fare that goes from $8 at 2 km to $20 at 8 km rises $12 over 6 km, so the slope is $2 per km. The intercept b = 8 − 2 × 2 = $4 is the fixed starting fee, and the full rule is fare = 2 × km + 4.

Slope from a Graph, Table, or Equation

From a graph: pick two points where the line crosses grid corners, count the rise (up is positive, down is negative), count the run to the right, and divide.

From a table: take any two rows and use the slope formula. If the slope is the same for every pair of rows, the data are linear. For x = 1, 2, 3 and y = 5, 8, 11, each step of 1 in x adds 3 to y, so m = 3.

From an equation: in y = mx + b, the slope is the number in front of x. In standard form Ax + By = C, the slope is m = −A ÷ B. For 3x − 2y = −1, m = −3 ÷ −2 = 1.5. If B = 0, the line is vertical.

Common Mistakes

  • Run over rise. Slope is change in y divided by change in x. Writing 4/6 instead of 6/4 gives the reciprocal.
  • Mixed subtraction order. Computing y₂ − y₁ on top but x₁ − x₂ on the bottom flips the sign.
  • Calling a vertical line slope 0. Horizontal lines have slope 0. Vertical lines have no slope at all.
  • Treating 100% grade as vertical. 100% grade is 45°. Grade measures rise per run, not a share of a right angle.
  • Calculator in radians. arctan(1.5) is 0.9828 in radians and 56.31 in degrees. Check the angle mode when converting by hand.
  • Rounding the slope early. Use 2/3 rather than 0.67 when finding b, or the intercept drifts.

Frequently Asked Questions

How do you find the slope between two points?
Use m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (5, 8): 6 ÷ 4 = 1.5. Keep the same order of subtraction on top and bottom.
What does a slope of zero or an undefined slope mean?
Zero slope is a horizontal line, y = b. Undefined slope is a vertical line, x = a, because the run is zero and division by zero is not defined.
How do you convert slope to degrees?
θ = arctan(m) in degree mode. Slope 1 is 45°, slope 0.5 is 26.57°. For percent grade, divide by 100 first: 10% grade is arctan(0.1) = 5.71°.
What is the slope of a perpendicular line?
The negative reciprocal, −1 ÷ m. Slope 3/2 becomes −2/3, slope −4 becomes 1/4. Parallel lines keep the same slope.
How do you find the equation of a line from two points?
Find m, substitute one point into y − y₁ = m(x − x₁), and solve for y. (1, 2) and (5, 8) give y = 1.5x + 0.5, or 3x − 2y = −1 in standard form.

Sources & References

  • OpenStax. Elementary Algebra 2e, 4.4 Understand Slope of a Line. openstax.org
  • OpenStax. Elementary Algebra 2e, 4.5 Use the Slope Intercept Form of an Equation of a Line. openstax.org
  • OpenStax. Elementary Algebra 2e, 4.6 Find the Equation of a Line. openstax.org
  • Weisstein, E. W. Slope, MathWorld (m = Δy ÷ Δx = tan θ). mathworld.wolfram.com

Results are for educational purposes. Check construction slopes against local codes. Methodology reviewed: 2026.