Slope Calculator
Calculate the slope, distance, midpoint and line equation from two points. Free and instant — everything updates as you type, right in your browser.
Negative and decimal coordinates are fine. The slope m = (y₂ − y₁) / (x₂ − x₁) is rise over run.
How to use the slope calculator
- Enter the first point. Type the x and y coordinates of any point on the line — negatives and decimals are allowed.
- Enter the second point. As soon as all four coordinates are filled in, every result is calculated instantly.
- Read the results. You get the slope m, the line equation y = mx + b, the distance and midpoint between the points, the angle of incline and the grade, plus the full working ready to copy.
About this tool
Slope measures how steep a line is: it is the rise (change in y) divided by the run (change in x) between any two points, written m = (y₂ − y₁) / (x₂ − x₁). This slope calculator computes m from your two points and then derives everything that follows from it — the y-intercept b = y₁ − m·x₁ and the slope-intercept equation y = mx + b, the straight-line distance √(Δx² + Δy²), the midpoint ((x₁+x₂)/2, (y₁+y₂)/2), the angle of incline θ = arctan(m), and the grade (slope expressed as a percentage). Vertical lines are handled correctly: the slope is reported as undefined and the equation as x = constant.
It is built for algebra and coordinate-geometry homework, but the same math describes real gradients: road signs quote grade percentages, wheelchair ramps are limited to a 1:12 slope (about 8.3%), and roof pitch is rise over run. Every calculation happens locally in your browser — the coordinates you enter are never uploaded, stored or logged.
Frequently asked questions
What does the slope value mean?
The slope is how many units the line rises for each unit it moves right. m = 2 means up 2 for every 1 across; m = −0.5 means down half a unit for every 1 across; m = 0 is a horizontal line. The larger the absolute value, the steeper the line.
Why is the slope of a vertical line undefined?
When both points share the same x-coordinate, the run Δx is 0, and the slope formula would divide by zero. Instead of a slope-intercept equation, a vertical line is written x = c. The calculator detects this case and shows the angle as 90°.
How is the angle of incline related to slope?
The angle θ between the line and the x-axis satisfies tan θ = m, so θ = arctan(m). A slope of 1 is a 45° angle, and negative slopes give negative angles (the line falls left to right). The grade is simply m × 100%.
Does the order of the two points matter?
No. Swapping the points negates both Δx and Δy, so the slope, the line equation, the distance and the midpoint all come out identical either way.