Home/Geometry/Slope Calculator

Slope Calculator

Calculate the slope (gradient), y-intercept, line equation, distance between two points, and angle of inclination.

๐Ÿ“– Reading time: 8โ€“10 minutes  ยท  Last updated: 31 July 2026  ยท  Reviewed by Mohsin Iqbal

Quick Answer: How Do You Calculate Slope?

Slope is rise over run: m = (yโ‚‚ โˆ’ yโ‚) / (xโ‚‚ โˆ’ xโ‚). From (2, 3) to (6, 11): rise = 8, run = 4, so m = 2 โ€” the line climbs 2 units for every 1 across. A slope of 0 is flat; a vertical line has an undefined slope, because run is zero and division by zero has no answer. In construction, the same value is often written as a percentage grade or a ratio like 1โˆถ10.

Formula Summary
Slope: m = (yโ‚‚ โˆ’ yโ‚) / (xโ‚‚ โˆ’ xโ‚) = rise / run
Slope-intercept form: y = mx + b  |  Point-slope form: y โˆ’ yโ‚ = m(x โˆ’ xโ‚)
Parallel lines: mโ‚ = mโ‚‚  |  Perpendicular lines: mโ‚ ร— mโ‚‚ = โˆ’1
Distance: d = โˆš((xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ)  |  Grade % = m ร— 100
Enter Two Points

Point 1: (xโ‚, yโ‚) and Point 2: (xโ‚‚, yโ‚‚). Results update as you type.

Keyboard: Enter calculates, Esc resets.


Quick Examples

Results
Slope (Gradient)
โ€”
PropertyValue

๐Ÿงญ Jump to a section

What Is Slope?

Slope (or gradient) measures how steep a line is โ€” how much it rises or falls for each unit it moves across. It is the single number that describes a line's direction, and it is central to graphing, calculus, construction grades, and physical quantities like speed and acceleration, which are themselves slopes on a graph of distance or velocity over time.

The Slope Formula

m = (yโ‚‚ โˆ’ yโ‚) / (xโ‚‚ โˆ’ xโ‚) = rise / run

Subtract the y-values to get the rise, subtract the x-values to get the run, then divide. From (2, 3) to (6, 11): rise = 8, run = 4, so m = 2. The order of the two points does not matter as long as you're consistent โ€” computing Pโ‚‚ โˆ’ Pโ‚ for both top and bottom.

Special Cases

CaseSlopeNote
Horizontal linem = 0No rise โ€” y is constant
Vertical lineUndefinedRun is zero โ€” division by zero has no answer
Parallel linesmโ‚ = mโ‚‚Same steepness, never intersect
Perpendicular linesmโ‚ ร— mโ‚‚ = โˆ’1Slopes are negative reciprocals

Line Equations

Slope-intercept form: y = mx + b, where b is the y-intercept.
Point-slope form: y โˆ’ yโ‚ = m(x โˆ’ xโ‚), useful when you have a point and the slope but no intercept.
Standard form: Ax + By = C.

Grade Percentage and Ratio

Road and roof grades are often expressed as a percentage (grade % = slope ร— 100) or a ratio like 1โˆถ10, meaning 1 unit of rise for every 10 units of run. A 10% grade is a slope of 0.1. Steeper slopes give a smaller ratio denominator โ€” 1โˆถ4 is much steeper than 1โˆถ20.

Worked Examples

Rising line (2, 3) to (6, 11)

m = (11โˆ’3)/(6โˆ’2) = 8/4 = 2

Falling line (0, 10) to (5, 0)

m = (0โˆ’10)/(5โˆ’0) = โˆ’10/5 = โˆ’2

Vertical line (3, โˆ’2) to (3, 7)

ฮ”x = 0, so slope is undefined โ€” the line is x = 3

Applications

FieldUse
ConstructionRoof pitch, ramp gradients, drainage falls
RoadsGrade signage, braking distance calculations
Data analysisTrend lines, rates of change
PhysicsVelocity as the slope of a distance-time graph

Common Mistakes

MistakeFix
Swapping x and y in the formulaRise (ฮ”y) is always the numerator
Mismatching point orderUse the same point first in both subtractions
Treating undefined as zeroA vertical line has no slope at all, not a slope of 0
Confusing slope with angleA 100% grade is a 45ยฐ angle, not 100ยฐ

Practice Questions

With answers

  1. Find the slope between (1, 2) and (5, 10).
  2. What is the slope of a horizontal line?
  3. Find the equation of the line through (0, 4) with slope 3.
Show answers

1) (10โˆ’2)/(5โˆ’1) = 2   2) m = 0   3) y = 3x + 4

๐Ÿ”‘ Key Takeaways

Frequently Asked Questions

What is slope?

Slope measures the steepness and direction of a line: how much it rises or falls for each unit it moves horizontally. It is calculated as rise over run, m = (yโ‚‚โˆ’yโ‚)/(xโ‚‚โˆ’xโ‚).

How do you calculate slope from two points?

Subtract the y-coordinates for the rise, subtract the x-coordinates for the run, then divide: m = (yโ‚‚โˆ’yโ‚)/(xโ‚‚โˆ’xโ‚). From (2,3) to (6,11), m = 8/4 = 2.

What does a negative slope mean?

A negative slope means the line falls as x increases โ€” moving right, y decreases. The steeper the negative number, the faster it falls.

Why is a vertical line's slope undefined?

Because the run (ฮ”x) is zero, and division by zero has no defined value. A vertical line is not a slope of zero โ€” it simply has no slope at all.

What is the y-intercept?

The point where a line crosses the y-axis, found by b = yโ‚ โˆ’ mร—xโ‚. It is undefined for a vertical line, since such a line either never crosses the y-axis or lies on it entirely.

How are parallel and perpendicular slopes related?

Parallel lines share the same slope (mโ‚ = mโ‚‚). Perpendicular lines have slopes that multiply to โˆ’1 (mโ‚ ร— mโ‚‚ = โˆ’1) โ€” one is the negative reciprocal of the other.

How do I convert slope to a percentage grade?

Multiply the slope by 100. A slope of 0.1 is a 10% grade โ€” 1 unit of rise for every 10 units of horizontal distance.

What is the angle of inclination?

The angle a line makes with the horizontal, found by taking the arctangent of the slope's absolute value. A slope of 1 corresponds to a 45ยฐ angle in either direction.

Does this calculator show the line equation?

Yes โ€” in slope-intercept form (y = mx + b) for standard lines, or x = constant for a vertical line, along with the point-slope form and the working.

Can slope be zero?

Yes โ€” a slope of exactly 0 means a perfectly horizontal line, where y stays constant as x changes.

References

Last updated: July 2026
Last reviewed: July 2026 โ€” Reviewed by Mohsin Iqbal
Every formula and worked example independently verified.