Slope Calculator
Find slope (m) between two points
What Is the Slope Calculator?
Slope describes how steeply a straight line rises or falls as you move along it, expressed as the ratio of vertical change ("rise") to horizontal change ("run") between any two points on the line. It's one of the core ideas in coordinate geometry, formalized when René Descartes and Pierre de Fermat combined algebra with geometric graphs in the 1600s, giving mathematicians a numeric way to describe direction and steepness instead of relying on visual estimation alone.
Slope is the "m" in the familiar slope-intercept form y = mx + b, and it stays constant everywhere along a straight line — which is exactly what makes lines "straight." For curves, the same idea generalizes into calculus, where the slope of the tangent line at a single point (the derivative) describes the curve's instantaneous rate of change. This calculator handles the straight-line case: give it two points, and it returns both the slope and the full line equation.
Slope shows up constantly outside the classroom too — road signs describe grade as a percentage slope, architects use "rise over run" for stair and roof pitch, and economists describe rates of change as the slope of a line on a graph. For a deeper look at working with the resulting equation, see the Linear Equation Solver, and for distance-based coordinate geometry, the Pythagorean Theorem Calculator is a natural complement.
Slope Calculator Formula
m = (y₂ − y₁) / (x₂ − x₁)
How Is the Slope Calculator Calculated?
Slope is the ratio of vertical change ("rise") to horizontal change ("run") between two points — dividing the difference in y-values by the difference in x-values gives a single number describing how steeply the line rises or falls. The order matters only in that it must be consistent: (y₂−y₁) must be paired with (x₂−x₁), not mixed with the other point's coordinate, though swapping both points at once always gives the same result.
Once you have the slope, you can find the full equation of the line using the point-slope form: pick either point, substitute it and the slope into y − y₁ = m(x − x₁), then rearrange into y = mx + c. This calculator performs that substitution automatically by solving for the y-intercept c = y₁ − m·x₁, so you get both the numeric slope and a ready-to-use equation in one step.
Slope Calculator Example
Points (1, 2) and (3, 6): m = (6−2) / (3−1) = 4/2 = 2, giving the line y = 2x.
Points (0, 5) and (4, −3): m = (−3−5) / (4−0) = −8/4 = −2, a negative slope, giving the line y = −2x + 5.
Points (1, 4) and (4, 6): m = (6−4) / (4−1) = 2/3 ≈ 0.6667, giving the line y ≈ 0.6667x + 3.3333 — a fractional slope that isn't a whole number.
How to Use the Slope Calculator
Step 1
Enter the coordinates of the first point (x₁, y₁).
Step 2
Enter the coordinates of the second point (x₂, y₂).
Step 3
Click Calculate Slope to see the slope and line equation.
Step 4
Check whether the slope is positive, negative, zero, or undefined to understand the line's direction.
Step 5
Use the generated equation (y = mx + c) to find the y-value for any x on that line.
Step 6
Try swapping which point is "first" and "second" — the slope should stay exactly the same.
Benefits
- Instantly returns both the slope and the complete line equation from just two points.
- Correctly flags vertical lines as undefined slope instead of returning an error or a wrong number.
- Works with negative, decimal, and fractional coordinates without extra setup.
- Solves for the y-intercept automatically, saving a manual point-slope substitution step.
- Free to use in the browser, with no sign-up required, on any device.
- Lets you save or send your line's slope and equation as a shareable image card for study groups or quick reference.
Common Slope Calculator Scenarios
Scenario 1
Graphing lines in algebra or coordinate geometry homework.
Scenario 2
Calculating grade/steepness in road design, ramps, or construction.
Scenario 3
Analyzing rate of change between two data points, like speed or growth rate.
Scenario 4
Determining whether two lines are parallel or perpendicular before proving a geometry theorem.
Scenario 5
Estimating a trend line's direction from two data points on a chart.
Scenario 6
Checking stair or roof pitch calculations against building code requirements.
Understanding Your Result
A positive slope means the line rises left to right; a negative slope means it falls. A slope of 0 is a horizontal line, and an undefined slope means the line is vertical — the two most extreme cases at either end of the slope scale.
The magnitude of the slope tells you how steep the line is: a slope of 5 rises much faster than a slope of 0.5, even though both are positive. The equation shown alongside the slope lets you plug in any x-value to find the corresponding y-value anywhere along that same line, without needing a third point.
Tips
- A steeper line has a slope further from zero (positive or negative).
- Parallel lines always have the same slope.
- Perpendicular lines have slopes that are negative reciprocals of each other.
- If your slope comes out as a repeating decimal, consider expressing it as a fraction for exactness in coursework.
- Plot both points on graph paper to visually double-check that the calculated slope's sign and steepness match what you see.
Common Mistakes
- Subtracting coordinates in the wrong order (must be consistent: y₂−y₁ over x₂−x₁, not mixed).
- Assuming every pair of points has a defined slope — vertical lines (same x-coordinate) do not.
- Confusing slope (rate of change) with the y-intercept (where the line crosses the y-axis).
- Rounding the slope too early and carrying that rounding error into the y-intercept calculation.
- Mixing up which point is (x₁, y₁) and which is (x₂, y₂) between the numerator and denominator.
Frequently Asked Questions
What does a negative slope mean?
A negative slope means the line goes downward from left to right; a positive slope means it goes upward. The steeper the descent, the more negative the slope value.
What does "undefined slope" mean?
When both points share the same x-coordinate, the line is vertical, and its slope is undefined since the denominator (x₂ − x₁) would be zero — division by zero has no defined result.
What does a slope of 0 mean?
A slope of 0 means the line is perfectly horizontal — the y-value stays the same regardless of x, since the numerator (y₂ − y₁) is zero.
How do I find the equation of the line?
Once you know the slope (m), substitute one point into y = mx + c and solve for c (the y-intercept) — this calculator does that step for you automatically.
What is the slope of two perpendicular lines?
Perpendicular lines have slopes that multiply to -1 — for example, a line with slope 2 is perpendicular to a line with slope -1/2.
How do I find the equation of the line from the slope?
Once you have the slope (m) and a point on the line, use the point-slope form y − y₁ = m(x − x₁), then simplify to slope-intercept form y = mx + b.
What is the slope of two parallel lines?
Parallel lines always have exactly the same slope — this is one of the defining properties of parallel lines on a graph, and it's how you can prove two lines are parallel algebraically.
Can I find the slope from just one point and the equation of a parallel line?
Yes — a line parallel to a known line shares the same slope, so you'd only need one additional point to fully determine the parallel line's equation.
Can slope be a fraction or decimal?
Yes — slope is simply a ratio of vertical change to horizontal change, and it's very commonly a fraction or decimal rather than a whole number, as shown in the third worked example above.
Can I share my slope result as an image?
Yes — tap Share and, on supported devices, your result is shared as a branded image card, not just a text link.
What is the relationship between slope and the angle a line makes with the x-axis?
Slope equals the tangent of the angle the line makes with the positive x-axis (m = tan θ) — a 45° line has a slope of exactly 1, and steeper angles produce larger slope magnitudes.
How do I convert a slope into a percentage grade, like on a road sign?
Multiply the slope by 100 — a slope of 0.05 (5 vertical units per 100 horizontal units) is displayed as a 5% grade on road signage.
Will two different pairs of points on the same line always give the same slope?
Yes — slope is a property of the entire line, not of any specific pair of points, so any two distinct points you pick on that line will always produce the identical slope value.
Can I find a line's equation if I only have one point and the slope?
Yes — substitute the point and slope into the point-slope form y − y₁ = m(x − x₁) and simplify; you don't need a second point once you already know the slope.
References
Important Information
Results are rounded to 4 decimal places.
Last updated: July 25, 2026