Slope Calculator
Two points · Line equation · Point at a distance · Angle and grade
📈 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
- 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.
- 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.
- 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
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.
Equation of a Line from Two Points
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.
| Grade | Slope m | Angle | Rise : run |
|---|---|---|---|
| 1% | 0.01 | 0.57° | 1 : 100 |
| 5% | 0.05 | 2.86° | 1 : 20 |
| 8.33% | 0.0833 | 4.76° | 1 : 12 |
| 10% | 0.1 | 5.71° | 1 : 10 |
| 25% | 0.25 | 14.04° | 1 : 4 |
| 50% | 0.5 | 26.57° | 1 : 2 |
| 100% | 1 | 45° | 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.
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.
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
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.