Slope Calculator
If the 2 Points are Known
Press Calculate to see the results.
If 1 Point and the Slope are Known
Gives the two points that lie the chosen distance from (X₁, Y₁) along a line with the given slope or angle.
Press Calculate to see the results.
Enter two points and this slope calculator finds the slope (gradient), angle of incline, distance between the points and the equation of the line through them.
The slope of a line, also called its gradient, measures how steep it is: how far it rises or falls for each unit you move to the right. It is usually written m. A slope of 2 means the line climbs 2 units for every 1 unit across; a slope of −0.5 means it drops half a unit for every unit across. Horizontal lines have a slope of 0, and vertical lines have an undefined slope because moving across by zero would mean dividing by zero.
Given two points on a line, the slope is the change in y, called the rise, divided by the change in x, called the run. For the points (3, 4) and (6, 8), the rise is 8 − 4 = 4 and the run is 6 − 3 = 3, so the slope is 4/3 ≈ 1.333. It does not matter which point you call the first, as long as you subtract in the same order on the top and the bottom.
Slope is closely tied to angle. The rise and run form the two legs of a right triangle, so the slope equals the tangent of the angle θ between the line and the horizontal. For a slope of 4/3, θ = tan⁻¹(4/3) ≈ 53.13°. The distance between the two points is the hypotenuse of the same triangle, √(3² + 4²) = 5, by the Pythagorean theorem.
Once the slope is known, the line's equation in slope-intercept form is y = mx + b, where b, the y-intercept, is the height at which the line crosses the y-axis. Substitute either point to find it: 4 = (4/3)(3) + b gives b = 0, so the line is y = 4x/3.
m = (y₂ − y₁) ÷ (x₂ − x₁) = tan θ
- (x₁, y₁), (x₂, y₂)
- two points on the line
- θ
- the angle the line makes with the positive x-axis
Working the other way, if you know one point, the slope and how far away the second point is, you can locate it. The angle comes from θ = tan⁻¹(m), and the second point lies a distance d along that direction: x₂ = x₁ + d cos θ and y₂ = y₁ + d sin θ. Because the line extends both ways, there is a second answer in the opposite direction, x₁ − d cos θ and y₁ − d sin θ. Starting at (1, 1) with a slope of 0.75 and a distance of 5 gives (5, 4) or (−3, −2).
Slopes describe real-world steepness in several notations. Road signs often state a percentage grade, which is the slope times 100: a 6% grade rises 6 feet for every 100 feet of horizontal distance. Roofers state pitch as rise over a 12-inch run, so a 6/12 roof has a slope of 0.5, about 26.6°. Accessibility guidelines in the United States limit wheelchair ramps to a slope of 1 : 12, about 4.8°.
Two lines are parallel when they have the same slope and perpendicular when their slopes multiply to −1, so a line with slope 2 is perpendicular to one with slope −1/2. In calculus the idea generalizes to curves: the derivative gives the slope of the tangent line at each point.
Frequently asked questions
How do you find the slope between two points?
Subtract the y-values and divide by the difference of the x-values: m = (y₂ − y₁) ÷ (x₂ − x₁). Between (1, 2) and (4, 11), m = 9 ÷ 3 = 3.
What does a negative slope mean?
The line falls as you move to the right. A slope of −2 drops 2 units for every unit across.
How do I convert slope to an angle?
Take the inverse tangent: θ = tan⁻¹(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.57°.
What is the slope of a vertical line?
It is undefined, because the run is zero and division by zero is not defined. A horizontal line has a slope of zero.
How is percentage grade related to slope?
Percentage grade is slope × 100. A slope of 0.08 is an 8% grade.
What is the point-slope form of a line?
If a line has slope m and passes through the point (x₁, y₁), its equation is y − y₁ = m(x − x₁). A line with slope 2 through (3, 5) is y − 5 = 2(x − 3), which simplifies to y = 2x − 1.
How do I find the equation of a line from two points?
Find the slope with m = (y₂ − y₁) ÷ (x₂ − x₁), then substitute either point into y = mx + b to get the intercept. Through (1, 2) and (4, 11), m = 3, and 2 = 3 × 1 + b gives b = −1, so the line is y = 3x − 1.
Updated by Calculator.hair. How we build and check our calculators