Slope Calculator
Enter or paste two points to find the exact slope, rise, run, steps, and graph.
- Rise Δy
- Run Δx
- Direction
Your slope steps
Slope formula from two points
For A = (x₁, y₁) and B = (x₂, y₂), the slope is m = (y₂ − y₁) / (x₂ − x₁) = rise / run. Keep the subtraction order consistent: if you start with y₂ − y₁, use x₂ − x₁ below it.
For A = (2, 3) and B = (7, -9), the rise is -9 − 3 = -12 and the run is 7 − 2 = 5. The exact slope is -12/5, or -2.4. The negative sign means the line falls as x increases.
Paste points without hiding the parsed values
The paste shortcut accepts common two-point forms such as (2, 3), (7, -9) and 2,3;7,-9. Apply fills the four coordinate fields first. You can inspect or edit each value before calculation, and a malformed point pair is rejected instead of guessed.
Changing any field immediately removes the old answer. On submit, the first empty or malformed coordinate receives focus and a field-specific message. The tool does not leave a result from older coordinates beside a changed input.
Why swapping the points keeps the same slope
Swapping A and B reverses both differences. Rise -12 becomes 12, while run 5 becomes -5. Since 12 / -5 and -12 / 5 are the same number, the slope is unchanged. Use Swap A and B to check this with your own points.
Vertical, horizontal, and repeated points
- Vertical line: x₁ = x₂, so run is 0 and slope is undefined.
- Horizontal line: y₁ = y₂, so rise is 0 and slope is 0.
- Same point twice: both differences are 0. One point does not define a unique line, so the calculator asks for a different second point.
Compare two point pairs
Open the comparison section to calculate a second line with the same exact rules. Matching slopes can describe parallel lines or the same line. The calculator checks the comparison points against the first line so it can distinguish those cases; different slopes mean the lines are not parallel.
Exact arithmetic, graph limits, and privacy
Coordinates can be integers, decimals with up to 6 places, or integer fractions. Exact rational arithmetic produces the simplified rise, run, and slope; a decimal is shown as a convenience. The graph uses equal units per pixel on both axes, but its plotted positions are still a visual aid.
This page handles Cartesian coordinates only. It does not calculate roof pitch, roadway grade, accessibility compliance, geographic coordinates, derivatives, or equations entered as text. All coordinate values stay in the current tab and are not placed in the URL, storage, share links, or analytics events.
Frequently asked questions
How do I calculate slope from two points?
Subtract the y coordinates in the same order that you subtract the x coordinates: m = (y₂ − y₁) / (x₂ − x₁). The numerator is the rise and the denominator is the run. This calculator preserves exact fractions and shows the substituted steps.
Can I paste two coordinate points?
Yes. Paste a pair such as (2, 3), (7, -9) or 2,3;7,-9, then choose Apply. The parsed coordinates stay visible in the four fields so you can check them before calculating.
Why is a vertical line’s slope undefined?
A vertical line has x₂ − x₁ = 0. The slope formula would divide the rise by zero, which is undefined. A horizontal line instead has zero rise and slope 0.
What if both points are the same?
One repeated point does not determine a unique line, so it cannot determine a unique slope. Enter a second point with a different x or y coordinate.
Does swapping the two points change the slope?
No. Swapping the points changes the signs of both rise and run, so their ratio stays the same. For example, -12/5 becomes 12/-5; both simplify to -12/5.
How does the line comparison work?
Enable Compare a second point pair. Equal slopes mean the lines are parallel or the same line; the calculator checks whether the comparison points also lie on the first line. Vertical lines are compared without trying to divide by zero.
Can I use decimals and fractions?
Yes. Each coordinate can be an integer, a decimal with up to 6 places, or an integer fraction such as 1/3. Exact arithmetic is used internally; coordinates are limited to ±1,000,000.
Are my coordinates saved or put in a share link?
No. Calculations run in the current browser tab. Coordinates are not added to the page URL, browser storage, clipboard unless you choose Copy result, or analytics events.