How to use the slope calculator
Two points. Enter (x₁, y₁) and (x₂, y₂). Whole numbers, decimals, negatives and fractions such as 3/4 all work. The calculator returns:
- the slope m, as an exact fraction when it does not come out as a short decimal
- the line’s equation in slope-intercept, point-slope and standard form
- the angle of inclination and the percent grade
- the distance between the points, the midpoint, and where the line crosses each axis
One point, slope and distance. Enter a starting point, the slope and how far to travel along the line. You get the two points at that distance, one in each direction.
The formulas
- Slope: m = (y₂ − y₁) ÷ (x₂ − x₁), rise over run
- y-intercept: b = y₁ − m × x₁
- Angle: θ = arctan(m), measured from the positive x-axis
- Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²), which is the Pythagorean theorem
- Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
- Point at distance d: Δx = d ÷ √(1 + m²) and Δy = m × Δx
The distance formula treats the run and the rise as the two legs of a right triangle. The triangle calculator can solve the rest of that triangle, including its angles.
Worked example: (2, 3) and (6, 11)
These are the points loaded with the page.
- Rise and run: the rise is 11 − 3 = 8 and the run is 6 − 2 = 4.
- Slope: m = 8 ÷ 4 = 2. The line climbs 2 units for every 1 unit to the right.
- Intercept: b = 3 − 2 × 2 = −1, so the equation is y = 2x − 1. In point-slope form it is y − 3 = 2(x − 2), and in standard form 2x − y = 1.
- Angle: arctan(2) = 63.43°. The percent grade is 200%.
- Distance: √(4² + 8²) = √80 = 8.944.
- Midpoint: ((2 + 6) ÷ 2, (3 + 11) ÷ 2) = (4, 7).
For the second mode, the default is the point (2, 3), slope 0.75 and distance 10. Since √(1 + 0.75²) = 1.25, Δx = 10 ÷ 1.25 = 8 and Δy = 0.75 × 8 = 6. That gives the points (10, 9) and (−6, −3). This is the 6-8-10 right triangle.
Special cases
- Horizontal line (same y): slope 0, angle 0°, equation y = constant.
- Vertical line (same x): the slope is undefined because the run is 0. The equation is x = constant and the angle is 90°.
- Identical points: two copies of the same point do not define a line, so the calculator asks you to change one.
Practical uses
Slope shows up as the pitch of a roof, the grade of a road or wheelchair ramp, and the rate of change on any graph. A ramp that rises 1 inch for every 12 inches has a slope of 1/12, about 8.33% or 4.76°. To turn a fraction slope into a percent, the percent calculator also helps.
Frequently asked questions
What does the slope of a line mean?
Slope is how much y changes for each one-unit step in x: rise over run. A slope of 2 climbs 2 units for every 1 across. A negative slope falls from left to right, 0 is flat, and a vertical line has an undefined slope because its run is 0.
How do I convert slope to an angle or a percent grade?
The angle is the arctangent of the slope: arctan(2) = 63.43°. The percent grade is the slope × 100, so a slope of 0.08 is an 8% grade, the kind of figure shown on road signs. A 45° line has slope 1, or a 100% grade.
What is the difference between slope-intercept and point-slope form?
Slope-intercept form, y = mx + b, shows the slope m and where the line crosses the y-axis, b. Point-slope form, y − y₁ = m(x − x₁), is built straight from a known point and the slope. They describe the same line and rearrange into each other.
Why are there two answers when I give a point, a slope and a distance?
A line goes in two directions. Moving the same distance forward or backward along it lands on two different points, one on each side of the starting point.
Last reviewed: