Slope Calculator

Calculate slope, y-intercept, line equation, distance, and midpoint from two points.

By Konstantin Iakovlev · Updated September 2026 · Source: Khan Academy

Slope (m)

1.3333

Equation

y = 1.3333x + 0.6667

Details

Y-Intercept (b)0.6667
Distance5.0000
Midpoint(2.50, 4.00)

Use the Slope Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only. Results are estimates based on the information you provide and the assumptions described on this page.

How It Works

Slope captures both how steep a line is and which way it tilts as it runs between two points on a coordinate plane. It threads through algebra, geometry, and calculus alike, giving you a handle on rates of change, the direction of a data trend, and the geometric behavior of figures.

The value, written as 'm', comes from m = (y2 - y1) / (x2 - x1): the 'rise', or change in y-coordinates, divided by the 'run', the change in x-coordinates, measured between two distinct points (x1, y1) and (x2, y2).

Label your points the same way every time, (x1, y1) and (x2, y2), so signs stay consistent when coordinates go negative. Two special cases are worth recognizing on sight: a vertical line divides by zero and so has an undefined slope, while a horizontal line has a slope of exactly zero.

Example: Slope of a Hillside Lot

  1. 1 An architect designing a house on a sloped lot picks two points from the terrain map, with horizontal distance and elevation in the same units: Point A (10, 50) and Point B (70, 20).
  2. 2 Using the slope formula: m = (20 − 50) / (70 − 10) = −30 / 60 = −0.5.
  3. 3 The calculator also gives the y-intercept, b = 50 − (−0.5 × 10) = 55, so the line is y = −0.5000x + 55.0000, along with the distance between the points, √(60² + 30²) = 67.0820, and the midpoint (40.00, 35.00).
  4. 4 The negative slope means the ground falls from left to right: every unit of horizontal distance lowers the elevation by 0.5 units, a 50% grade, which is the figure grading and foundation design start from.

Source: Khan Academy · Last updated: September 2026

Frequently Asked Questions

How do you calculate slope from two points?
Slope (m) equals (y2-y1)/(x2-x1), or rise over run. For points (2,3) and (6,11), slope = (11-3)/(6-2) = 8/4 = 2.
What does a slope of 0 mean?
A slope of 0 means the line is perfectly horizontal. There is no rise between any two points. An undefined slope (division by zero) means the line is perfectly vertical.
How do you write a line equation from slope and a point?
Use point-slope form: y - y1 = m(x - x1). With slope m=3 and point (2,5): y - 5 = 3(x - 2), which simplifies to y = 3x - 1 in slope-intercept form.