How to use the slope calculator
- Type the first point into x₁ and y₁, and the second into x₂ and y₂. Negatives, decimals and fractions like 1/2 are accepted.
- Read the slope m at the top as a reduced fraction and a decimal, with the rise (Δy) and run (Δx) beneath it.
- Use the line equation in slope-intercept, point-slope and standard form, and check the angle, percent grade and the parallel and perpendicular slopes.
- Press Horizontal or Vertical to see slope 0 and an undefined slope.
How the slope formula works
Slope is rise over run: m = (y₂ - y₁) / (x₂ - x₁), as defined in OpenStax Intermediate Algebra, section 3.2. Swapping the two points flips the sign of both the rise and the run, so the slope is unchanged. The y-intercept is b = y₁ - m × x₁, which gives y = mx + b. The angle of inclination is arctan(m), kept between 0° and 180°, so a falling line has an angle above 90°. The percent grade is m × 100. Parallel lines share a slope, and perpendicular slopes multiply to -1. All arithmetic uses exact fractions, so a slope of 1/3 is never shown as a rounded 0.333.
Worked example with the starting numbers
The page opens with (1, 2) and (4, 8). The rise is 8 - 2 = 6 and the run is 4 - 1 = 3, so m = 6 / 3 = 2. The intercept is b = 2 - 2 × 1 = 0, so the slope-intercept form is y = 2x, the point-slope form is y - 2 = 2(x - 1) and the standard form is 2x - y = 0. The angle of inclination is arctan(2) = 63.43°, the percent grade is 200%, a parallel line has slope 2, and a perpendicular line has slope -1/2.
Limits and edge cases
When both points have the same x, the line is vertical, the run is 0 and the slope is undefined; the tool shows x = number and an angle of 90°. When both y values match, the slope is 0. Entering the same point twice defines no line. Each number may have up to 40 digits, and both axes need the same unit for an angle or grade to mean anything. To measure the segment, use the distance formula calculator; for its center, the midpoint calculator; for curves, the quadratic formula calculator.
Slope FAQ
What does a slope of 0 mean?
A slope of 0 means the line is horizontal: the y value never changes, so the rise is 0. Its equation is y equal to a constant, such as y = 5, and any line perpendicular to it is vertical.
What is an undefined slope?
A vertical line has an undefined slope because its run is 0, and dividing by zero has no value. Every point on it has the same x value, so its equation is x equal to a constant, such as x = 3.
How do I find the y-intercept?
Find the slope m first, then use b = y₁ - m × x₁ with either point. For (1, 2) and (4, 8), m = 2 and b = 2 - 2 × 1 = 0, so the line crosses the y-axis at (0, 0).
How do I convert slope to an angle?
Take the arctangent of the slope. A slope of 2 gives arctan(2) = 63.43°. For a negative slope the result is negative, so add 180° to get an angle from 0° to 180°; a slope of -1 gives 135°.
Does the order of the points matter?
No. Swapping the points flips the sign of both the rise and the run, so the slope stays the same. (1, 2) to (4, 8) and (4, 8) to (1, 2) both give m = 2.