Slope Calculator
Choose what you know, enter your numbers, and see the formula worked out.
Calculate slope, rise, run, distance, midpoint, angle of incline, percent grade, y-intercept, and the equation of a line. Enter two points, a point and slope, or rise and run to see the formula and step-by-step math.
Choose what you know, enter your numbers, and see the formula worked out.
Slope describes how steep a line is and which direction it moves as you travel from left to right. A line can rise, fall, stay flat, or move straight vertically, and slope gives us a mathematical way to describe that behavior.
One of the easiest ways to remember slope is rise over run. Rise tells you how much the y-value changes. Run tells you how much the x-value changes. The formula is m = (y₂ − y₁) ÷ (x₂ − x₁), where the letter m usually represents slope.
Suppose two points are (2, 3) and (7, 11). The vertical change is 11 − 3 = 8. The horizontal change is 7 − 2 = 5. So slope = 8 ÷ 5 = 1.6. That means for every 5 units the line moves to the right, it rises 8 units. You could also describe the same relationship as 1.6 units of rise for each 1 unit of run.
Look at two points on a line. Moving from the first point to the second requires horizontal movement and vertical movement. The horizontal movement is the run. The vertical movement is the rise.
Mathematically, rise is Δy = y₂ − y₁, and run is Δx = x₂ − x₁. Then m = Δy ÷ Δx. The Greek letter Δ means "change in," so Δy means change in y and Δx means change in x. This is why slope is also often described as a rate of change. It tells you how much y changes when x changes.
A positive slope means the line rises from left to right. Example: m = 2. For every 1 unit right, the line rises 2 units. Example line: y = 2x + 1, with points (0,1), (1,3), (2,5). As x increases, y increases.
A negative slope means the line falls from left to right. Example: m = −2. For every 1 unit right, the line moves 2 units downward. Example: y = −2x + 5, with points (0,5), (1,3), (2,1).
A horizontal line has a slope of 0. Example: points (2,5) and (8,5). Rise = 5 − 5 = 0. Run = 8 − 2 = 6. Slope = 0 ÷ 6 = 0. Equation: y = 5. No matter how far you move horizontally along this line, the y-value does not change.
A vertical line has an undefined slope. Example: points (4,2) and (4,9). Rise = 7. Run = 4 − 4 = 0. The slope formula would require 7 ÷ 0, and division by zero is undefined, so the slope is undefined. The equation is x = 4. Do not describe the slope as Infinity; undefined is the mathematically appropriate result.
Rise = 0, Run ≠ 0
Rise ≠ 0, Run = 0
No, as long as you stay consistent. Using (2,3) and (7,11), we found rise = 11 − 3 = 8, run = 7 − 2 = 5, slope = 8/5. Now reverse the point order. Rise = 3 − 11 = −8. Run = 2 − 7 = −5. Slope = −8 ÷ −5 = 8/5. Both signs changed, and the final slope stayed the same. The mistake happens when someone reverses the subtraction for y but not for x. Always subtract coordinates in the same point order.
(y₂−y₁) ÷ (x₂−x₁)
(y₁−y₂) ÷ (x₁−x₂)
Incorrect mixed order: (y₂−y₁) ÷ (x₁−x₂) = 8/−5 — subtracting y in one order and x in the other order produces the wrong sign. Always use the same point order for both subtractions.
Once you know slope, you can find the equation. A common form is y = mx + b, where m is the slope and b is the y-intercept. Using (2,3) and (7,11), we already found m = 8/5. Now substitute x = 2, y = 3: 3 = 8/5(2) + b, so 3 = 16/5 + b. Convert 3 to 15/5: 15/5 = 16/5 + b, therefore b = −1/5. The equation is y = 8/5x − 1/5. The decimal version is y = 1.6x − 0.2.
The y-intercept is where a line crosses the y-axis. At the y-axis, x = 0. In y = mx + b, the value b is therefore the y-coordinate when x = 0. For y = 8/5x − 1/5, the y-intercept is (0, −1/5).
Another useful line equation is y − y₁ = m(x − x₁). This is called point-slope form. It is helpful when you already know one point and the slope. Example: point (2,3), slope 8/5. Then y − 3 = 8/5(x − 2). This equation describes the same line as y = 8/5x − 1/5. The form looks different; the line is the same.
The midpoint is halfway between two coordinate points. Formula: M = ((x₁+x₂)/2, (y₁+y₂)/2). For (2,3) and (7,11): x-coordinate = (2+7)/2 = 4.5, y-coordinate = (3+11)/2 = 7. Midpoint: (4.5, 7).
The horizontal and vertical changes form the legs of a right triangle, which means we can use the Pythagorean theorem. Distance: d = √[(x₂−x₁)² + (y₂−y₁)²]. Using (2,3) and (7,11): run = 5, rise = 8. Distance = √(5² + 8²) = √89 ≈ 9.43. The Pythagorean Theorem Calculator can help if your main goal is solving the side lengths of a right triangle.
Slope can also be represented as an angle. For a nonvertical line, m = tan(θ), therefore θ = tan⁻¹(m). Suppose slope = 1. Then θ = tan⁻¹(1) = 45°. If m = 0.5, then θ ≈ 26.565°. The Scientific Calculator can help with inverse tangent and other trigonometric calculations.
No. Slope and angle describe the same line in different mathematical forms. Slope: m = rise/run. Angle: θ = arctan(m). Example: slope 0.5, angle ≈ 26.565°. You should not say "the slope is 26.565" when you mean the angle is 26.565°.
In real-world applications, slope is sometimes expressed as a percentage. Formula: percent grade = rise/run × 100%. Suppose rise = 6 feet, run = 100 feet. Grade = 6/100 × 100 = 6%. A 6% grade means the vertical change is 6 units for every 100 of the same horizontal units. The rise and run need to use compatible units before forming the percentage; if rise is feet and run is miles, you cannot divide those numbers directly and call the result a percent grade. Convert them to matching units first.
The Science Education Resource Center at Carleton College also explains slope and gradient as "rise over run," including how slope is used with real-world elevation changes and why units must be handled carefully when calculating percent slope. Their slope and gradient guide provides another useful educational explanation.
No, and this is a common misunderstanding. A 100% grade means rise = run. Example: 100 ft rise for 100 ft horizontal run. Slope = 1. Angle = arctan(1) = 45°. A truly vertical line has zero horizontal run, so its ordinary slope is undefined. This is why percent grade and degrees should not be treated as interchangeable.
Roads: road grades describe how much elevation changes over horizontal distance. Ramps: ramp design may involve rise, run, slope, and grade, and specific accessibility requirements should always be checked against applicable current building or accessibility standards rather than relying only on a general calculator. Roofs: roof pitch relates vertical rise to horizontal run, and construction convention may express roof pitch differently from ordinary percent grade. Topographic maps: elevation change and horizontal distance can be used to describe terrain steepness. Water flow: gradient can help describe how elevation or hydraulic level changes with distance. Graphs: in algebra, science, economics, and statistics, slope can describe rate of change, such as miles traveled per hour, dollars earned per hour, temperature change per minute, or another dependent-variable change relative to an independent variable.
Slope and rate of change are closely related. Suppose x represents hours worked and y represents money earned. If y increases by $20 each time x increases by 1 hour, the slope is 20 dollars per hour. Unlike a pure coordinate geometry exercise, units may matter here: slope can have units such as miles/hour, dollars/hour, feet/mile, or degrees/day. A percent grade is unitless only after compatible rise and run units cancel.
Parallel lines have the same slope. Example: y = 2x + 1 and y = 2x − 5. Both have slope 2; their y-intercepts differ. Because their slopes are equal, they never meet in ordinary Euclidean coordinate geometry.
Nonvertical, nonhorizontal perpendicular lines have slopes that are negative reciprocals. If m = 2, the perpendicular slope is −1/2. If m = −3/4, the perpendicular slope is 4/3. Multiply perpendicular slopes: 2 × −1/2 = −1. Special case: horizontal and vertical lines are perpendicular to each other. The Triangle Calculator can also be useful when your coordinate work becomes part of a larger geometry problem involving triangle sides, angles, or area.
Ordinary coordinate slope is rise/run. Percent grade takes that ratio and multiplies by 100%. If you simply need to calculate a percentage unrelated to slope, use the Percentage Calculator. Do not use the Percentage Calculator as a replacement for coordinate geometry slope calculations.
Do not leave knowing only "my slope is 1.6." Leave knowing what slope measures, what rise means, and what run means. Understand Δy and Δx, and why slope is rise over run. Understand positive slope and negative slope, and know the difference between zero slope and undefined slope. Know that point order does not change the slope when subtraction is consistent. Understand how two points determine the equation of a nonvertical line, and know what the y-intercept represents. Know how the midpoint is calculated, and understand how the distance formula relates to the Pythagorean theorem. Know how slope relates to angle, and understand the difference between slope, percent grade, and degrees. Know why compatible units matter in real-world grade calculations. Understand parallel slopes and perpendicular slopes. And most importantly: you can see how the calculator arrived at the slope. That is what the CalculateThisWay Slope Calculator should help someone understand.
| What You Need | Formula |
|---|---|
| Slope from Two Points | m = (y₂−y₁)/(x₂−x₁) |
| Rise | Δy = y₂−y₁ |
| Run | Δx = x₂−x₁ |
| Slope-Intercept Form | y = mx+b |
| Point-Slope Form | y−y₁ = m(x−x₁) |
| Y-Intercept | b = y−mx |
| Midpoint | ((x₁+x₂)/2, (y₁+y₂)/2) |
| Distance | √[(x₂−x₁)²+(y₂−y₁)²] |
| Angle | θ = arctan(m) |
| Percent Grade | Rise/Run × 100% |
| Parallel Slope | same m |
| Perpendicular Slope | −1/m |
I need slope, rise/run, grade, angle, midpoint, distance, intercepts, or the equation of a line.
You are hereI need triangle sides, angles, area, or a complete triangle solution.
Open Calculator ›I need inverse tangent, trigonometry, powers, roots, or advanced arithmetic.
Open Calculator ›I need an ordinary percentage calculation rather than coordinate slope.
Open Calculator ›What is slope?
Slope measures the steepness and direction of a line.
What is the slope formula?
m = (y₂−y₁)/(x₂−x₁).
What does rise over run mean?
Rise is the vertical change and run is the horizontal change.
What does Δy mean?
Change in y.
What does Δx mean?
Change in x.
What does positive slope mean?
The line rises from left to right.
What does negative slope mean?
The line falls from left to right.
What does zero slope mean?
The line is horizontal.
What does undefined slope mean?
The line is vertical because its horizontal change is zero.
Is vertical slope infinity?
No. The ordinary slope is undefined.
Does point order matter?
Not if you subtract both x and y coordinates using the same order.
How do I find slope from two points?
Subtract the y-values, subtract the x-values in the same order, then divide rise by run.
How do I find the equation of a line?
Find slope, calculate the y-intercept, then use y = mx+b.
What is point-slope form?
y−y₁ = m(x−x₁).
What is the y-intercept?
The point where a nonvertical line crosses the y-axis.
What is the midpoint formula?
Average the x-coordinates and average the y-coordinates.
How do I calculate distance between two coordinate points?
Use the distance formula, which comes from the Pythagorean theorem.
How do slope and angle relate?
m = tan(θ), so θ = arctan(m).
Is slope the same as degrees?
No.
What is percent slope?
Rise divided by run, multiplied by 100%.
Is a 100% grade vertical?
No. A 100% grade corresponds to a slope of 1 and an angle of 45°.
Is a 50% grade the same as 50 degrees?
No.
Why do units matter for percent grade?
Rise and run must be expressed in compatible units before the ratio can be interpreted as a percentage.
What slope do parallel lines have?
The same slope.
What slope do perpendicular lines have?
For ordinary nonzero finite slopes, they are negative reciprocals.
What is perpendicular to a horizontal line?
A vertical line.
What is perpendicular to a vertical line?
A horizontal line.
Can this calculate a line equation?
Yes.
Can this calculate percent grade?
Yes.
Can this calculate angle from slope?
Yes.
Can this calculate slope from an angle?
Yes.
This calculator keeps exact fractions where practical, reducing rise and run to lowest terms rather than rounding immediately. A vertical line (zero run) is always reported as an undefined slope, never as Infinity, and a horizontal line (zero rise) is always reported as a slope of exactly zero, never as undefined. Two identical points are rejected as not forming a unique line rather than producing a 0/0 or NaN result. Percent grade calculations convert rise and run to a common unit before dividing, so mismatched units such as feet and miles are never divided directly. Results may be rounded for display while calculations retain full internal precision; use the "Show more decimals" control to see additional digits.