What this slope calculator calculates
Use Two points to calculate slope from x1, y1, x2, and y2. Use Rise and run to enter Rise (Δy) and Run (Δx) directly. A selected Unit changes the coordinate label only; it does not convert the values.
Nonvertical results include the slope, direction, and angle of inclination. The line equation is shown only in Two points mode. A vertical result reports an undefined slope instead of showing an angle or line equation.
How to calculate a slope
- Select Two points or Rise and run.
- Choose a Unit if you want to label the coordinates.
- Enter the required numeric values.
- Select Calculate.
- Use Copy result or Download result (.txt) to save the plain-text result.
Understand the result
For two points, the calculator uses m = (y2 − y1) / (x2 − x1). For direct inputs, it uses m = rise / run. The rise is the vertical change and the run is the horizontal change.
- A horizontal line has a slope of
0. - A negative slope means the line falls from left to right as x increases.
- If the run is
0and the rise is nonzero, the line is vertical and the slope is undefined. The result does not include an angle or line equation. - In Two points mode, a nonvertical result can include the line equation in slope-intercept form.
Input validation and limits
Fill in every required field with a value matching the calculator's supported decimal-number pattern. Empty fields and invalid text are rejected. Values with an absolute magnitude greater than 1e12 are also rejected, and the calculator rejects a computed slope that is not finite.
Two identical points are rejected because they do not define a line. In Rise and run mode, a rise and run of both 0 are rejected. A zero run with a nonzero rise is accepted as a vertical line.
Privacy and limitations
The calculation runs locally in your browser, and the tool does not upload the values used for the calculation. The page may still make other requests, such as analytics, page-view handling, or the server-backed subscription form.
The Unit selection labels coordinates but does not convert them. The calculator does not plot a line, infer missing values, or provide certified surveying, engineering, or professional advice.
Frequently Asked Questions
What is the slope formula?
For two points (x1, y1) and (x2, y2), slope m = (y2 - y1) / (x2 - x1). It measures how much y changes (rise) for every unit change in x (run).
What does a negative slope mean?
A negative slope means the line falls from left to right - as x increases, y decreases. A positive slope means the line rises from left to right.
What happens when the run is zero?
When x2 equals x1 (run = 0), the line is vertical and the slope is undefined, since division by zero is not defined. This calculator reports that case explicitly rather than showing a number.
What if the rise is zero?
When y2 equals y1 (rise = 0), the line is horizontal and the slope is exactly 0, regardless of the run value (as long as the run is not also zero).
What units does this calculator support?
You can label coordinates as unitless or in millimeters, centimeters, meters, kilometers, inches, feet, yards, or miles. Slope itself is a dimensionless ratio when both axes share the same unit, so the calculator does not attach a unit to the slope value - it only labels the coordinates you entered.