Slope Calculator (Two Points)
Enter two points in the coordinate plane. The calculator returns the slope, simplified rise/run, angle, grade percent, and line equation.
What Is Slope?
Slope is a number that describes how steep a line is and the direction it moves as you go from left to right. In algebra and coordinate geometry, slope is often called rise over run: the vertical change divided by the horizontal change.
If slope is positive, the line rises to the right. If slope is negative, it falls to the right. A slope of zero is a horizontal line, and an undefined slope means the line is vertical.
How the Formula Works
Standard Slope Formula
For two points \((x_1, y_1)\) and \((x_2, y_2)\), slope is:
m = (y₂ - y₁) / (x₂ - x₁)
- Rise = \(y₂ - y₁\)
- Run = \(x₂ - x₁\)
- Slope = Rise ÷ Run
The order of subtraction must stay consistent. If you use \(y₂ - y₁\), then you must also use \(x₂ - x₁\).
Interpreting Your Results
Decimal Slope
The decimal form is helpful for quick calculations and graphing software. For example, a slope of 2.5 means the line goes up 2.5 units for every 1 unit to the right.
Fraction (Simplified Rise/Run)
Fraction form is often easier to visualize on graph paper. A slope of 3/4 means up 3, right 4. A slope of -5/2 means down 5, right 2.
Angle and Grade
The calculator also provides:
- Angle (degrees): computed with arctangent of slope.
- Grade (%): slope × 100, commonly used in roads, ramps, and civil engineering.
Line Equation from Two Points
Once slope is known, you can build the equation of the line in slope-intercept form:
y = mx + b
where \(m\) is the slope and \(b\) is the y-intercept. This calculator computes \(b\) for you automatically. For vertical lines (when \(x_2 - x_1 = 0\)), the equation is instead:
x = constant
Common Mistakes to Avoid
- Swapping the order in numerator but not denominator.
- Forgetting that dividing by zero gives an undefined slope (vertical line).
- Confusing slope with distance between points.
- Rounding too early and losing precision in engineering or physics work.
Real-World Uses of Slope
- Construction: roof pitch, ramp accessibility, drainage design.
- Finance charts: trend line steepness in time-series data.
- Physics: velocity from position-time graphs, acceleration from velocity-time graphs.
- Data science: interpreting linear regression coefficients.
Quick FAQ
Can slope be a decimal?
Yes. Any real number can be a slope, including decimals and fractions.
What does undefined slope mean?
It means the line is vertical. The run is zero, so slope cannot be computed as a finite number.
What if both points are exactly the same?
Then there is no unique line through “two” distinct points, so slope and equation are not uniquely defined.