Slope Calculator
Enter two coordinate points to calculate the slope of a line, rise, run, angle, classification, and equation with clear steps.
Increasing line
y = 0.6x + 1.8
- Rise = 6 − 3 = 3.
- Run = 7 − 2 = 5.
- m = 3/5 = 0.6.
Embed Slope Calculator
Copy this iframe code into a page that permits embeds.
All calculations run locally in your browser. Your entered values are not sent to an external service.
How to Use the Slope Calculator
Enter the x-coordinate and y-coordinate for two different points on the same line. Keep each x-value paired with its matching y-value. Select Calculate Slope or press Enter from any coordinate field.
- Label the first point (x₁, y₁) and the second point (x₂, y₂).
- Enter all four coordinates, including negative signs.
- Review the exact reduced fraction and decimal value.
- Use the rise, run, angle, and equation to interpret the line.
Reversing both points does not change the slope because both differences change sign. Reversing only one subtraction does change the answer incorrectly. If the points are identical, infinitely many lines pass through that single location, so one unique slope cannot be found.
Slope Formula Between Two Points
Slope measures vertical change for each unit of horizontal change. The numerator y₂ − y₁ is the rise. The denominator x₂ − x₁ is the run. The same units should be used consistently for each axis.
The order of subtraction must match. If the rise is y₂ − y₁, the run must be x₂ − x₁. You may instead subtract point 2 from point 1 in both places. The two negative signs cancel, producing the same ratio.
Reduced fraction and decimal slope
A fraction preserves the exact rise-to-run ratio. For a rise of 3 and run of 5, the slope is exactly 3/5. Its decimal form is 0.6. When the decimal repeats, the calculator rounds its display while keeping the reduced ratio as the clearer exact answer.
Equation of the line
For a nonvertical line, slope-intercept form is y = mx + b. After finding m, substitute either point to calculate b = y − mx. A vertical line cannot be written in slope-intercept form. Its equation is x = constant.
Positive, Negative, Zero, and Undefined Slope
| Slope type | What the line does from left to right | Example |
|---|---|---|
| Positive | Rises as x increases | m = 2/3 |
| Negative | Falls as x increases | m = −2/3 |
| Zero | Stays horizontal | m = 0 |
| Undefined | Stays vertical | run = 0 |
A horizontal line has zero rise and a nonzero run, so zero divided by a nonzero number equals zero. A vertical line has zero run. Division by zero is undefined, which is why a vertical line has no finite slope.
The size of the absolute slope describes steepness when both axes use comparable scales. A slope of 4 changes vertically four units for each horizontal unit. A slope of 1/4 changes only one vertical unit for every four horizontal units.
Slope Calculator Examples
Positive slope
For points (2, 3) and (7, 6), the rise is 6 − 3 = 3 and the run is 7 − 2 = 5. Therefore, m = 3/5 = 0.6. The line rises three units whenever it moves five units to the right.
Negative slope
For points (0, 5) and (3, 3), the rise is 3 − 5 = −2 and the run is 3 − 0 = 3. The slope is −2/3. The negative sign means y decreases as x increases.
Horizontal line
For points (−2, 4) and (3, 4), the y-values match. Rise equals zero and run equals five, so the slope is 0/5 = 0. The equation is y = 4.
Vertical line
For points (2, 1) and (2, 9), both x-values equal 2. The run is zero, so the slope is undefined. The line equation is x = 2 and its inclination angle is 90 degrees.
Decimal coordinates
For (0.5, 1.25) and (2.5, 4.25), rise equals 3 and run equals 2. The slope is 3/2 = 1.5. Decimal coordinates do not require a different formula.
What Slope Means in Graphs and Real Data
On a graph, slope is a constant rate of change for a straight line. If y represents distance and x represents time, slope represents speed. If y represents cost and x represents quantity, slope represents the additional cost per unit.
Units matter. A rise measured in dollars divided by a run measured in hours produces dollars per hour. The number alone is incomplete in an applied problem. Report the slope with its units and explain what one unit of x does to y.
Average rate of change
For a curved graph, the slope between two points is the average rate of change across that interval. It is the slope of the secant line joining the points, not the instantaneous slope at every location. Calculus uses a limiting process to find an instantaneous rate.
Angle of inclination
The calculator reports an angle from the positive x-axis, measured counterclockwise from 0 to 180 degrees. For a finite slope, tan(θ) = m. A negative slope therefore has an inclination between 90 and 180 degrees, while a vertical line has an angle of 90 degrees.
Gradient terminology
In coordinate geometry, gradient is another name for slope. Civil engineering and road design may express gradient as a ratio or percentage. A 0.05 slope equals a 5 percent grade because 0.05 × 100 = 5 percent. Confirm the convention used in the specific field before converting.
How to Check a Slope Result
Substitute both points into the reported line equation. Each point should make the equation true, apart from small rounding differences if the displayed decimal repeats. You can also draw a rise-and-run triangle and verify that its vertical and horizontal legs produce the same ratio.
If you swap the two points, recalculate. Both rise and run should reverse sign, leaving the slope unchanged. For example, 3/5 becomes (−3)/(−5), which still equals 3/5.
Common mistakes
Mixing the subtraction order
Subtract the coordinates in the same point order in both the numerator and denominator.
Dropping a negative sign
Place negative coordinates in parentheses before subtracting. Subtracting a negative value becomes addition.
Calling a vertical slope zero
Vertical lines have zero run and undefined slope. Horizontal lines have zero rise and zero slope.
Using two copies of the same point
One point does not define a unique line. Enter two distinct coordinate locations.
Ignoring units or graph scale
Interpret slope using the units and scale assigned to the x-axis and y-axis.
Slope Calculator FAQs
What is the formula for slope?
The slope is m = (y₂ − y₁) / (x₂ − x₁), which is rise divided by run.
Why is a vertical line’s slope undefined?
A vertical line has zero horizontal change, and division by zero is undefined.
What does a slope of zero mean?
It means the line is horizontal and its y-value does not change as x changes.
Can I use decimal or negative coordinates?
Yes. The calculator accepts finite positive, negative, zero, and decimal coordinates.
Does swapping the two points change the slope?
No. Swapping both points reverses the signs of rise and run, so their ratio stays the same.
How is slope related to rate of change?
For a straight line, slope is its constant rate of change in y for each unit change in x.
Are my coordinates sent to a server?
No. The calculation runs locally in your browser.
Related Algebra Calculators
System of Equations SolverFind where two lines written as equations meet.
Quadratic Formula CalculatorRoots when factoring is not the right tool.
Midpoint CalculatorMidpoint of a segment.
Factoring CalculatorFactor ax² + bx + c over the integers.
Simplify CalculatorExpand and combine like terms.
Explore More Algebra Tools
Continue with equation, coordinate, distance, and polynomial tools in the SolverCalc algebra collection.
Reviewed by Prof. Dr. Khalil Mudassar (PhD) · Last updated: [mc_modified_date]
Sources
Disclaimer
This calculator is intended for general educational and practical use. Review important results before relying on them in professional work.