Slope of a Line Calculator
Calculate the slope (gradient) of a straight line through two coordinate points using the rise-over-run formula. Also reports the angle of inclination in degrees. Enter x1, y1, x2, y2.
How to use this tool
- Enter x1, y1, x2 and y2 in the fields above.
- Results update instantly as you type โ or click Calculate.
- Read your slope (m) and the full breakdown beneath it.
Formula
m = (y2-y1)/(x2-x1); angle = atan(m) in degrees
How it works
Slope m = (y2โy1) / (x2โx1). Inclination angle ฮธ = arctan(m) in degrees.
Worked example
Rise 3, run 4
- m
- =
- 3
- /
- 4
- =
- 0
- .
- 7
- 5
- .
- a
- n
- g
- l
- e
- =
- a
- r
- c
- t
- a
- n
- (
- 0
- .
- 7
- 5
- )
- =
- 3
- 6
- .
- 8
- 7
- d
- e
- g
- .
Common mistakes to avoid
- Dividing run by rise instead of rise by run โ slope is (y2-y1)/(x2-x1), not the reciprocal.
- Entering the same x-value for both points (a vertical line), which causes division by zero โ vertical lines have undefined slope, not zero slope.
- Confusing a zero slope (horizontal line, y2=y1) with an undefined slope (vertical line, x2=x1).
Key terms
Frequently asked questions
- What does a negative slope mean?
- A negative slope means the line falls from left to right. For every unit you move right along the x-axis, the y-value decreases by the absolute value of the slope.
- How is slope related to the angle of inclination?
- The angle theta satisfies tan(theta) = slope, so theta = atan(slope) in degrees. A slope of 1 gives a 45 degree angle; steeper lines have larger angles up to (but not including) 90 degrees.
- Do the two points need to be in any particular order?
- No โ swapping the two points negates both the numerator and denominator, so the slope (their ratio) is unchanged.