Slope Calculator
Enter two points for the slope (also as a fraction), y-intercept, distance, angle and line equation, or find a missing coordinate from a point and a slope. How it works
Use the Slope Calculator
About the Slope Calculator
The slope through (0, 0) and (5, 10) is 2: the rise is 10 and the run is 5. This slope calculator takes two points and shows the slope m = (y2 − y1) / (x2 − x1), the y-intercept (0), the distance between the points (11.1803), the angle of the line (63.43°), the percent grade (200.00%), the equation y = 2.00x + 0.00, the point-slope form and the perpendicular slope (-0.5). The slope also shows as a reduced fraction, -2/3 for (-2, 3) and (4, -1), and a second mode finds a missing coordinate from one point and a slope. A vertical line has no slope and is written x = c.
Run and rise to slope, angle and distance
| Run | Rise | Slope | Angle | Distance |
|---|---|---|---|---|
| 4 | 3 | 0.7500 | 36.87° | 5.0000 |
| 10 | 10 | 1.0000 | 45.00° | 14.1421 |
| 12 | 1 | 0.0833 | 4.76° | 12.0416 |
| 100 | 5 | 0.0500 | 2.86° | 100.1249 |
| 100 | 10 | 0.1000 | 5.71° | 100.4988 |
Each row is the line from (0, 0) to (run, rise). A percent grade is the slope times 100, so 0.0500 is a 5% grade, which the page shows as a percent grade of 5.00%.
How to use this tool
- Enter x1 and y1 for the first point and x2 and y2 for the second. The fields start at (0, 0) and (5, 10).
- Read the slope, the slope as a fraction, the equation, the point-slope form, the y-intercept, the perpendicular slope, the angle, the percent grade and the distance.
- To find a missing coordinate instead, choose Find a missing coordinate, enter point 1, the slope (or a percent grade) and the X2 or Y2 you know.
Frequently asked questions
- How do you find the slope between two points?
- Divide the change in y by the change in x. For (-2, 3) and (4, -1) the rise is -1 − 3 = -4 and the run is 4 − (-2) = 6, so m = -4 / 6 = -0.6667. The y-intercept is b = 3 − (-0.6667)(-2) = 1.6667, and the equation is y = -0.67x + 1.67.
- What is the slope of a horizontal or a vertical line?
- A horizontal line has slope 0: (1, 5) and (4, 5) give y = 0.00x + 5.00, and its perpendicular slope is shown as Undefined (vertical). A vertical line has a run of 0, so its slope is undefined: (2, 3) and (2, 9) show Undefined (Vertical), no y-intercept, an angle of 90.00° and the equation x = 2.
- How do I convert a slope to an angle or a percent grade?
- The angle is atan(m) in degrees. A rise of 1 over a run of 12 is a slope of 0.0833 and an angle of 4.76°. A rise of 5 over a run of 100 is a slope of 0.0500 and an angle of 2.86°. The angle is measured from the positive x axis and stays between -90° and 90°, so a falling line such as (-2, 3) to (4, -1) shows -33.69°, not 146.31°. The percent grade is the slope times 100, shown to 2 decimals: 0.0500 is a 5% grade (5.00%) and the 1-in-12 ramp is 8.33%. A vertical line has no grade and shows Undefined.
- What is the perpendicular slope?
- It is the negative reciprocal, −1/m. A line with slope 2 has a perpendicular slope of -0.5, and a line with slope 0.75 has one of -1.3333. The product of two perpendicular slopes is -1, except when one line is horizontal and the other vertical.
- How do I find a missing coordinate from the slope?
- Choose Find a missing coordinate. With point 1 at (1, 2), slope 3 and X2 = 4, the page uses y2 = y1 + m(x2 − x1) = 2 + 3 × 3 and shows Y2 = 11.0000. Given Y2 instead it uses x2 = x1 + (y2 − y1) / m: from (0, 0) at an 8% grade (slope 0.08), Y2 = 4 gives X2 = 50.0000. A slope of 0 is a horizontal line, so it has no X2 for a different Y2, and the page says so.
- What is point-slope form?
- It is y − y1 = m(x − x1), written with the first point. For (-2, 3) and (4, -1) the page shows y − 3 = -0.6667(x + 2). The slope-intercept equation, y = -0.67x + 1.67, is the same line with m and b rounded to 2 decimals, so for closer work use the point-slope form or the 4-decimal slope and intercept.
Related Tools
View all toolsRoof Pitch Angle Calculator
Roof pitch from rise and run or an angle: degrees, x:12 pitch and slope percent, with a slope class. A 6-in rise over a 12-in run is 26.57°.
Derivative Calculator
Enter f(x) and a point x = a to get f′(a), f(a), the tangent line and its graph, plus the formula for f′(x). Flags corners, jumps and vertical tangents.
Midpoint Calculator
Midpoint of two points in 2D or 3D by ((x₁ + x₂)/2, (y₁ + y₂)/2), or a missing end point by B = 2M − A, with the working shown and exact sums.
Stair Calculator
Stair layout from the floor-to-floor rise: risers and treads, exact riser height, total run, stringer length and angle, with the IRC limits flagged.
RREF Calculator
Reduce a matrix of up to 6 × 6 to reduced row echelon form by Gauss-Jordan elimination, with rank, pivot columns and row steps, as decimals or exact fractions.
Eigenvalue Calculator
Eigenvalues and eigenvectors of a 2 × 2 or 3 × 3 matrix from its characteristic equation, with the trace and determinant and complex pairs a ± bi.