100% Free No Sign-Up Unlimited Use No Limits Secure & Private
PDF Tools Calculators Categories Guides Contact No Sign-Up Needed to Use This Site
Slope (m)
--
Enter points to calculate
Y-Intercept (b)
--
Angle (°)
--
Distance
--
Midpoint
--
Steps will appear here.

Find the slope, y-intercept, line equation, distance, and midpoint between two points, or work with a slope derived from an angle or a parallel/perpendicular relationship.

How It Works

How Slope Calculator Works

Given two points, slope is calculated as "rise over run": m = (y₂ − y₁) / (x₂ − x₁). Once the slope is known, the y-intercept follows from b = y₁ − m×x₁, giving the full line equation in the familiar y = mx + b form.

The calculator also reports the straight-line distance between the two points (using the distance formula, derived from the Pythagorean theorem) and their midpoint (the average of each pair of coordinates), plus the line's angle from horizontal, found by taking the arctangent of the slope.

In "From Angle" mode, a slope is generated directly from an angle using tan(angle) — since slope is, by definition, the tangent of the angle a line makes with the horizontal. In "Parallel/Perpendicular" mode, entering a known slope instantly gives the parallel slope (identical value) and the perpendicular slope (its negative reciprocal, −1/m).

Worked Example

See It In Action

For the points (0, 0) and (4, 3): rise = 3−0 = 3, run = 4−0 = 4, so slope m = 3/4 = 0.75. The y-intercept b = 0 − 0.75×0 = 0, giving the equation y = 0.75x. The distance between the points is √(4²+3²) = √25 = 5, the midpoint is (2, 1.5), and the line's angle from horizontal is arctan(0.75) ≈ 36.87°.
Real-World Use Cases

Who Uses Slope Calculator and Why

  • Finding the equation of a line through two data points for an algebra or coordinate geometry assignment.
  • Computing a roof pitch or grade as a rise-over-run slope from two measured points.
  • Checking whether two lines are parallel or determining the exact perpendicular slope for a fence or wall layout.
  • Getting the straight-line distance and midpoint between two coordinates alongside the slope calculation.
Common Mistakes

Mistakes to Avoid

  • Swapping the rise and run — computing (x₂−x₁)/(y₂−y₁) instead of (y₂−y₁)/(x₂−x₁) — which inverts the slope value.
  • Expecting a defined slope when both points share the same x-coordinate — that describes a vertical line, where the run is zero and slope is mathematically undefined.
  • Entering a raw slope value into the 'From Angle' mode's angle field, or vice versa — the two modes expect different kinds of input (a degree measure versus a plain ratio).
Pro Tips

Tips for Best Results

  • An 'Undefined' slope result is a strong signal that your two points share an x-coordinate (a vertical line) — it's not a calculation error.
  • Use Parallel/Perpendicular mode to get the negative reciprocal instantly instead of computing −1/m by hand.
Troubleshooting

Fixing Common Problems

The slope shows as 'Undefined'. — This happens when both points share the same x-coordinate, producing a vertical line — since the run (change in x) is zero, dividing by it has no defined value.

Glossary

Terms Explained

Y-intercept: The point where a line crosses the y-axis, found as b = y₁ − m×x₁ once the slope is known.

Negative reciprocal: The value −1/m of a given slope m, which describes the slope of any line perpendicular to it.

FAQ

Frequently Asked Questions

What does it mean if the slope shows as "Undefined"?
A slope is undefined when the two points share the same x-coordinate, producing a vertical line — since the "run" (change in x) is zero, and dividing by zero has no defined value.
How is the perpendicular slope calculated?
The perpendicular slope is the negative reciprocal of the original slope: if a line has slope m, any line perpendicular to it has slope −1/m. This ensures the two lines meet at exactly 90°.
What's the difference between slope and angle?
Slope is a ratio (rise over run) describing steepness numerically, while angle expresses the same steepness in degrees from horizontal. The two are directly related: slope = tan(angle).
Can slope be zero?
Yes — a slope of zero describes a perfectly horizontal line, where the y-coordinate doesn't change no matter how x changes (y₁ equals y₂).