Slope Calculator

Enter two points to find the slope, distance, midpoint, and line equation. See the complete solution with step-by-step working and formula explanations.

x
x
y
y

Enter your values above to see the results.

Tips & Notes

  • Slope = rise/run. Rise = y₂−y₁ (vertical change). Run = x₂−x₁ (horizontal change).
  • Verify your equation by substituting both original points into y=mx+b — both must satisfy it.
  • Parallel lines: same slope. Perpendicular lines: slopes multiply to −1. Slope 2/3 → perpendicular is −3/2.
  • Road grade % = slope × 100. A road rising 12 ft over 200 horizontal ft: slope = 0.06 = 6% grade.
  • Slope from a graph: pick 2 clear grid intersection points, count squares up (rise) and right (run).

Common Mistakes

  • Subtracting y in opposite order from x — if y uses y₂−y₁ then x must also use x₂−x₁, never reversed.
  • Putting x values in the numerator. Slope = (y₂−y₁)/(x₂−x₁), never (x₂−x₁)/(y₂−y₁).
  • Confusing slope 0 (horizontal, y=constant) with undefined slope (vertical, x=constant).
  • Swapping x and y coordinates. Point (3,7) has x=3, y=7 — not x=7, y=3.
  • Stopping after finding slope without computing b. Full equation needs both m and b.

Slope Calculator Overview

The slope of a line measures both its steepness and direction — how much the y-coordinate changes for each unit increase in the x-coordinate. A positive slope rises from left to right; a negative slope falls; zero slope is horizontal; undefined slope is vertical. Slope appears in every field that analyzes rates of change: the slope of a distance-time graph is velocity, the slope of a velocity-time graph is acceleration, the slope of a cost function is marginal cost, and the slope of a regression line quantifies how much one variable changes per unit change in another.

The slope formula — given two points (x₁,y₁) and (x₂,y₂):

m = (y₂ − y₁) / (x₂ − x₁) = rise / run
EX: Points (2,3) and (6,11) → m = (11−3)/(6−2) = 8/4 = 2 — rises 2 units for each unit right
EX: Points (−1,4) and (3,−4) → m = (−4−4)/(3−(−1)) = −8/4 = −2 — falls 2 units per unit right
Line equation from slope and one point:
EX: slope m=2, point (2,3) → y−3 = 2(x−2) → y = 2x−1 | verify with (6,11): 2(6)−1=11 ✓
Distance between the same two points:
d = √((x₂−x₁)² + (y₂−y₁)²)
EX: Points (2,3) and (6,11) → d = √(16+64) = √80 = 4√5 ≈ 8.944
Midpoint of the segment:
EX: Midpoint of (2,3) and (6,11) → ((2+6)/2, (3+11)/2) = (4, 7)
Parallel and perpendicular slopes: - Parallel lines: identical slopes (m₁ = m₂). Lines 2x+3y=6 and 4x+6y=12 are parallel — same slope −2/3. - Perpendicular lines: slopes are negative reciprocals (m₁ × m₂ = −1). Slope 3/4 → perpendicular slope is −4/3.
EX: Line with slope 2 is perpendicular to a line with slope −1/2. Check: 2×(−1/2) = −1 ✓
Slope is the rate at which the output changes per unit of input — the conversion factor between the two variables. Positive slope means both increase together; negative slope means one decreases as the other increases; zero slope means the output is constant regardless of input. In physics, slope on a position-time graph is velocity; on a velocity-time graph, it is acceleration. In economics, slope of the demand curve is price sensitivity; slope of the cost curve is marginal cost. Perpendicular lines have slopes that are negative reciprocals of each other: if one line has slope m, any line perpendicular to it has slope −1/m. Parallel lines have identical slopes — same steepness and direction, different vertical position. The midpoint formula gives the point exactly halfway between two points, and the distance formula extends the Pythagorean theorem to measure the length of any line segment in the coordinate plane.

Frequently Asked Questions

Slope measures rise over run — how much y changes for each unit increase in x. Formula: m = (y₂−y₁)/(x₂−x₁). Example: from (2,3) to (6,11): m = (11−3)/(6−2) = 8/4 = 2. This means for every 1 unit right, y increases by 2. Positive slope: rises left-to-right. Negative slope: falls left-to-right. Zero slope: horizontal line. Undefined slope: vertical line (denominator = 0). The slope is the same for any two points on the same straight line.

Lines with equal slopes are parallel. Lines with slopes that are negative reciprocals are perpendicular. Parallel example: lines with slope 3 are parallel — y=3x+1 and y=3x−5 never intersect. Perpendicular example: slope 2 and slope −1/2 are perpendicular (2 × (−1/2) = −1). The product of perpendicular slopes always equals −1. Example: verify y=3x+2 ⊥ y=−x/3+5. Slopes 3 and −1/3: product = 3×(−1/3) = −1 ✓.

The slope of a curve at a specific point equals the derivative of the function at that point. For f(x) = x², slope at x=3: f′(x)=2x, f′(3)=6. This is the slope of the tangent line at (3,9). Average slope over an interval [a,b]: (f(b)−f(a))/(b−a) — this is the slope of the secant line. The instantaneous slope (derivative) is the limit of the secant slope as the interval shrinks to zero: f′(a) = lim(b→a)(f(b)−f(a))/(b−a).

Point-slope form uses a known point and slope: y−y₁ = m(x−x₁). Example: slope 3 through (2,5): y−5 = 3(x−2) → y = 3x−1. Slope-intercept form: y = mx + b (slope m, y-intercept b). Standard form: Ax + By = C. To convert: 3x−y=1 → y=3x−1 (slope=3, intercept=−1). For a line through two points: find slope first, then use point-slope form with either point — both give the same equation.

In data analysis, slope appears in linear regression as the coefficient that describes how much the response variable changes per unit change in the predictor. In the equation ŷ = mx + b: m=slope tells you the predicted change in y for each unit increase in x. Example: m=2.5 for salary vs. experience (years) means each additional year of experience predicts $2,500 more salary. Positive slope means positive association; negative slope means negative association; near-zero slope means little linear relationship.

The slope of a straight line is constant everywhere: rise over run between any two points gives the same value. In calculus, the derivative extends this concept to curved functions. The derivative f'(x) at a point gives the slope of the tangent line to the curve at that point — the instantaneous rate of change. For a straight line y = mx + b, the derivative is simply m (constant). For y = x², the derivative is 2x, meaning the slope changes: at x=1 the slope is 2, at x=3 the slope is 6. This calculator finds the slope of a straight line using two points. For curves, use the derivative calculator to find the slope at any specific point.