Math / calculator
Slope Calculator
Find slope, rise, run and line equation from two points, or enter slope and one point. Vertical lines return undefined slope and an explicit x equation.
Calculator
Calculator
Find a slope and line equation.
Enter two distinct points, or a finite slope and one point. Vertical lines are identified explicitly rather than displayed as numeric infinity.
Your result
Enter details to see the result.
Complete the inputs and calculate to see the main result and its supporting breakdown.
Example
Worked example
Example inputs
- Known information
- Two points
- x₁
- 1
- y₁
- 2
- x₂
- 3
- y₂
- 6
Calculation breakdown
Rise=y2−y1; run=x2−x1; m=rise/run when run≠0. The intercept is b=y1−mx1 and y=mx+b. With a supplied slope, y−y1=m(x−x1). A vertical line is x=x1.
- Rise
- 4
- Run
- 2
- Line equation
- y = 2x + 0
Example result
Slope
2
How to interpret the result
Slope is rise divided by run. The vertical-line message is a valid geometric result; an identical-point error means more information is needed, while the displayed line equation uses the supplied coordinate system.
How to use this calculator
- Choose two points or a slope plus one point.
- Enter finite coordinates in a consistent Cartesian system; use distinct points for two-point mode.
- Calculate rise, run and the line equation; read undefined slope as a vertical line rather than a numeric rate.
How it works
Formula
Rise=y2−y1; run=x2−x1; m=rise/run when run≠0. The intercept is b=y1−mx1 and y=mx+b. With a supplied slope, y−y1=m(x−x1). A vertical line is x=x1.
How do I find slope from two points?
Subtract the first y value from the second for rise, subtract the first x value from the second for run, then divide rise by run. A zero run with distinct points means a vertical line; identical points do not define a unique line.
What this calculator does
Slope measures change in y per unit change in x. Two distinct points determine a line; when their x coordinates match, the line is vertical and no finite numeric slope exists. You can also supply a known slope and one point.
Who this is useful for
Students and planners finding the change rate and equation of a straight line from coordinate pairs or a known slope and point.
Inputs you will need
Some inputs appear only for the operation or shape you select.
Required or selected inputs
- Known information
- x₁
- y₁
- x₂
- y₂
- Slope m
What to check before using the result
Slope is rise divided by run and retains its sign. Swapping both points preserves slope; reversing just one difference does not. A vertical line has zero run and an undefined slope, while a horizontal line has zero slope. Use matching axis units before interpreting a slope as a physical gradient or converting it into an angle.
Assumptions
- Both points use the same Cartesian coordinate system; entered values are finite and bounded.
- Two-point mode needs distinct points; identical coordinates do not determine a unique line.
Limitations
- A vertical line has undefined slope and cannot be written as y=mx+b. No numeric Infinity is treated as a slope.
- This tool solves straight lines, not regression or curve fitting; rounded display values can obscure very small differences.
Useful next steps
Plot a line or other function and inspect coordinates with Graphing Calculator.
Find a right-triangle length from coordinate-leg measurements with Pythagorean Theorem Calculator.
Solve sides and angles of the corresponding triangle with Triangle Calculator.
See how HandyChest handles units, validation, rounding, and testing, or Report a problem with this calculator.
Good to know
Frequently asked questions
Can slope be negative or zero?
Yes. Negative slope falls as x increases. Zero slope is a horizontal line with no rise; a vertical line instead has undefined slope.
Keep going