Line Slope Calculator

Find line slope and y-intercept from two points.

Your details

Your data stays in your browser

Result

Enter both points’ coordinates, then press “Find the slope”.

Analysis and suggestions

Once calculated, this shows what your result means and suggestions based on your numbers.

Behind the result

Line equation is y = mx + b. Equal x coordinates do not define a finite slope.

How it is calculated

Comprehensive Calculator Guide

The slope of a line through two points is the change in y divided by the change in x: m = (y₂ − y₁) ÷ (x₂ − x₁). The line through (1, 2) and (3, 6) has slope 2 and y-intercept 0, so its equation is y = 2x. Enter both points to get the slope and intercept instantly.

Slope and the equation y = mx + b

Slope is rise per unit of run: positive lines climb left to right, negative ones fall, horizontal lines have slope 0, and vertical lines have an undefined slope because the run is zero. Once you have m, the intercept is b = y₁ − m × x₁. For (−2, 5) and (4, 2): m = −3 ÷ 6 = −0.5 and b = 4, so y = −0.5x + 4.

Parallel lines share a slope; perpendicular slopes multiply to −1.

Grades and angles

Multiply the slope by 100 for a grade: a ramp rising 0.5 m over 6 m has slope 0.0833, an 8.33% grade, the common 1:12 ratio for wheelchair ramps. For an angle take the arctangent: 0.0833 is about 4.76°, and a slope of 1 is exactly 45°.

How to Use

  1. Enter x₁ and y₁ for the first point.
  2. Enter x₂ and y₂ for the second; the order of points does not change the slope.
  3. Read the slope and y-intercept and write y = mx + b.

Formula Used

m = (y₂ − y₁) ÷ (x₂ − x₁) | b = y₁ − m × x₁ | y = mx + b

Practical Examples

Example 1: through the origin
(1, 2) and (3, 6): slope 2, intercept 0, y = 2x.
Example 2: negative slope
(−2, 5) and (4, 2): slope −0.5, intercept 4, y = −0.5x + 4.
Example 3: an access ramp
Rising 0.5 m over 6 m: slope 0.0833, an 8.33% or 1:12 grade.

Important Tips

  • Subtract in the same order top and bottom: second point minus first in both.
  • Check by substituting the second point into your equation.

Common Mistakes to Avoid

  • Dividing the run by the rise.
  • Confusing an undefined slope (vertical) with zero slope (horizontal).

Frequently Asked Questions

How do I find the slope from two points?
(y₂ − y₁) ÷ (x₂ − x₁): (2, 3) and (5, 9) give 6 ÷ 3 = 2.
When is the slope undefined?
When the line is vertical, so both points share the same x.
How do I write the line's equation?
Find m, then b = y₁ − m × x₁, and write y = mx + b.
How do I turn slope into a percentage or angle?
Percentage = slope × 100; angle = arctan(slope).

Read Also

Results are estimates for educational purposes and may vary depending on your situation and data sources.