Utilorca

Slope calculator

Slope calculator by Utilorca (utilorca.com): free, no sign-up, runs in your browser. Enter two points to find the slope of their line. See the rise and run, an exact reduced fraction for integer coordinates, the line equation, a signed angle and the distance between the points, with a graph and worked substitution.

Point A
Point B

Enter each coordinate in its own box, between −1 billion and 1 billion. Decimal numbers are accepted; expressions and pairs pasted into one box are not.

Formula: m = (y₂ − y₁) / (x₂ − x₁), b = y₁ − mx₁. Reference: Math is Fun.

Private by design: your files are processed on your device and never uploaded.

How to use it

  1. Enter x and y for point A and point B, using the same units on both axes.
  2. Calculate to see m = Δy / Δx and the equation. A vertical line is shown as x = constant.
  3. Review the steps and graph. Copy the results; rounded decimals are marked by the precision note.

Questions and answers

What is the formula for slope?

Subtract y coordinates and divide by the difference in x coordinates, keeping the point order the same: m = (y₂ − y₁) / (x₂ − x₁). For A(1, 2) and B(5, 4), m = 2/4 = 1/2.

Why is the slope undefined for a vertical line?

The change in x is zero, so the slope formula would divide by zero. Its equation is x = x₁. A horizontal line instead has zero rise and slope 0. Identical points do not define a unique line.

Does the order of the two points matter?

No. Reversing both points changes the signs of rise and run together, leaving the slope, line and distance unchanged. The signed angle uses arctan(m), so a negative slope is displayed with a negative angle.

Common questions and fixes

Why is a vertical line’s slope undefined?

A vertical line has zero run: x₂ − x₁ = 0. Dividing the rise by zero is undefined, so its equation is x = constant rather than y = mx + b. A horizontal line has zero rise and a nonzero run, which gives slope 0. If both differences are zero, the points coincide and do not determine a unique line.

Step by step
  1. Enter A(3, −2) and B(3, 9). The calculator reports undefined slope and x = 3.
  2. Change B to (8, −2). Both y coordinates are equal, so the slope is 0 and the equation is y = −2.
  3. Set both points to (3, −2). This is rejected because infinitely many lines pass through one point.

How do I find a line equation from two points?

For A(1, 2) and B(4, 3), the slope is (3 − 2) / (4 − 1) = 1/3. Substitute A into y = mx + b: b = 2 − 1/3 = 5/3. The line is y = (1/3)x + 5/3. This calculator preserves exact fractions in the equation when all four coordinates are integers.

Step by step
  1. Enter A(1, 2) and B(4, 3), then calculate. Read the exact slope 1/3.
  2. Use b = y₁ − mx₁. Keep 1/3 as a fraction to get b = 5/3 without early rounding.
  3. Check x = 1 and x = 4 in y = (1/3)x + 5/3. The outputs must be 2 and 3.

What does a negative slope mean for angle and percent?

A negative slope means y decreases as x increases. For A(1, 5) and B(5, 3), m = −2/4 = −0.5. With equal axis units, the percent gradient is 100m = −50%, while the signed angle is arctan(−0.5) ≈ −26.565°. A percentage gradient is a ratio, not an angle in degrees.

Step by step
  1. Enter A(1, 5) and B(5, 3). Calculate to see rise −2, run 4 and exact slope −1/2.
  2. Multiply the slope by 100 to express it as a percent gradient: −0.5 × 100 = −50%.
  3. Compare the signed angle, about −26.565°. Reversing both points preserves the slope and this angle convention.

Embed this tool on your website

Free for blogs, schools and business sites: paste this code into any page (WordPress, Blogger, Wix, Squarespace or plain HTML). It runs in your visitors’ browsers, with no ads, sign-up or tracking cookies.