Slope Calculator

Enter two points, a point and slope, a line equation, or rise over run to find the exact and decimal slope, gradient, intercepts, equivalent line equations, angle, graph, and a personalized worked solution.

Choose what you know

Try an example:

Point 1
Point 2
Exact fractions are calculated from the characters you enter.

Choose a mode and enter values, or select a quick example to see a complete solution.

Privacy: calculations happen entirely in your browser; entered values are not uploaded.

Graph

Your browser does not support canvas. The graph data is provided below.

No graph yet. Enter values or choose an example.

Advertisement

How to Find Slope

How to use this calculator

  1. Choose the information given in your problem.
  2. Enter integers, decimals, or fractions such as 1/3.
  3. Select decimal precision and calculate.
  4. Read the exact result first, then follow the substituted steps and graph.

The slope formula

For P₁(x₁, y₁) and P₂(x₂, y₂), rise is Δy = y₂ − y₁ and run is Δx = x₂ − x₁.

m=y2y1x2x1

This is “rise over run.” Keep the subtraction order the same in the numerator and denominator.

Four slope types

Positive: m > 0; the line rises from left to right.
Negative: m < 0; the line falls from left to right.
Zero: m = 0; the line is horizontal, y = constant.
Undefined: Δx = 0; the line is vertical, x = constant. Two identical points are different: they define no unique line.

Finding slope from an equation

Solve the equation for y and read the coefficient of x. From Ax + By = C, subtract Ax and divide by B: y = (−A/B)x + C/B, so m = −A/B. If B = 0, the equation is vertical.

Angle, percent grade, parallel and perpendicular lines

This calculator reports the signed direction angle θ = arctan(m) in the range −90° to 90°; it does not call a negative result an inclination. Percent grade is 100m%. Distinct nonvertical parallel lines have the same slope. For nonzero m, a perpendicular line has the negative reciprocal −1/m. Horizontal and vertical lines are perpendicular to each other.

Common mistakes

  • Reversing the subtraction order in only one part of the fraction.
  • Calling duplicate points a vertical line instead of recognizing that no unique line is defined.
  • Rounding before the final step instead of keeping an exact fraction.
  • Writing decimal standard-form coefficients when all coefficients can be scaled to relatively prime integers.
  • Confusing the signed direction angle used here with inclination, which is commonly measured from 0° to 180°.

Worked Slope Examples

Positive fractional slope

For P₁(−2, 1.5) and P₂(3, 4): Δy = 4 − 1.5 = 2.5, Δx = 3 − (−2) = 5, so m = 2.5/5 = 1/2 = 0.5. Then b = 1.5 − (1/2)(−2) = 2.5, so y = (1/2)x + 5/2. Before normalization, the standard equation is correctly 2.5x − 5y = −12.5; normalized integer form is x − 2y = −5.

Negative slope

For P₁(1, 4) and P₂(3, 0): Δy = 0 − 4 = −4, Δx = 3 − 1 = 2, and m = −4/2 = −2 = −2.0. The line is y = −2x + 6, or 2x + y = 6.

Horizontal line

For P₁(−2, 3) and P₂(3, 3): Δy = 3 − 3 = 0, Δx = 3 − (−2) = 5, and m = 0/5 = 0 = 0.0. The equation is y = 3.

Vertical line

For P₁(2, −1) and P₂(2, 4): Δy = 4 − (−1) = 5, Δx = 2 − 2 = 0. Because division by zero is undefined, the slope has no numeric value and the equation is x = 2.

Slope from standard form

For 2x + 3y = 12, isolate y: 3y = −2x + 12, then y = (−2/3)x + 4. Thus m = −2/3 ≈ −0.666667, with rise −2 and run 3.

Slope Calculator FAQs

How do I find slope from two points?

Find y₂ − y₁, find x₂ − x₁ in the same order, and divide: m = (y₂ − y₁)/(x₂ − x₁).

What is rise over run?

Rise is the vertical change Δy; run is the horizontal change Δx. Their ratio Δy/Δx is the slope.

Why is a vertical slope undefined?

A vertical line has Δx = 0. Its slope would require division by zero, so use the equation x = constant instead.

What is the slope of a horizontal line?

Zero. Its y-value does not change, so Δy = 0 for every nonzero run.

How do I find slope from an equation?

Rewrite the equation as y = mx + b; the coefficient m is the slope. Directly from Ax + By = C, m = −A/B when B ≠ 0.

How do I convert slope to an angle or percentage?

Use θ = arctan(m) for the signed direction angle in degrees and grade = 100m% for percentage. A vertical line has a 90° direction but no finite grade.

What are parallel and perpendicular slopes?

Parallel nonvertical lines have equal slopes. Perpendicular nonvertical lines have negative-reciprocal slopes, so their product is −1. Horizontal and vertical lines are perpendicular.

Methodology and Review

Calculation method: entered finite decimals and fractions are converted directly to rational numbers. Rise, run, slope, intercepts, and equation coefficients are calculated exactly. Standard form is scaled to relatively prime integer coefficients with the first nonzero coefficient positive. Only display-only decimals, angles, distances, and percentages are rounded to the selected precision.

The formulas and equation workflow follow the openly available OpenStax Elementary Algebra explanation of slope.

Mathematical review: Starlight Tools editorial team · Reviewed and updated July 16, 2026.

Explore more tools