Skip to content

Math

Slope Calculator

Enter two points, (x1, y1) and (x2, y2). The calculator returns the slope, the y-intercept, the equation in y = mx + b form, the distance between the points, and the angle of the line in degrees. A vertical line has an undefined slope and no y-intercept unless it is the y-axis. Results are rounded.

Updated 2026-11-12 Editorial estimate Calccc Editorial Team Free · No sign-up

Loading calculator…

What this calculator does

The slope of a line measures how steeply it rises or falls: the change in y divided by the change in x. Two points are enough to find it, along with the line's equation, the straight-line distance between the points, and the angle the line makes with the horizontal. This calculator handles horizontal lines, vertical lines, negative slopes, and fractional results. It is a geometry and algebra tool, not a substitute for graphing the line.

How to use it

  1. Enter x1 and y1 for the first point.
  2. Enter x2 and y2 for the second point.
  3. Read the slope and the y-intercept.
  4. Check the equation in y = mx + b form.

How it works

Slope m = (y2 - y1) / (x2 - x1). Y-intercept b = y1 - m x x1. Equation: y = mx + b. Distance = the square root of ((x2 - x1)^2 + (y2 - y1)^2). Angle = the arctangent of the slope in degrees. When x2 = x1, the slope is undefined and the line is vertical: x = x1.

Example calculations

Example 1: (1, 2) and (4, 8)

The rise is 6 and the run is 3, so the slope is 2 and the y-intercept is 0. The equation is y = 2x, the distance is about 6.71, and the angle is about 63.43 degrees.

Example 2: (0, 5) and (10, 5)

The rise is 0, so the slope is 0 and the equation is y = 5. The distance is 10, and the angle is 0 degrees, a horizontal line.

Example 3: (2, 7) and (2, 10)

The run is 0, so the slope is undefined. The line is vertical at x = 2, the distance is 3, and the angle is 90 degrees.

What the result means

A positive slope rises left to right; a negative slope falls. A slope of 0 is flat, and a slope of 1 rises one unit per unit to the right. The units matter: if x is hours and y is dollars, the slope is dollars per hour. The y-intercept is where the line crosses the y-axis, which is y when x is 0. A vertical line has no slope because the run is zero; writing x = 2 is correct, and calling its slope 0 would describe a horizontal line. The angle runs from -90 to 90 degrees for a non-vertical line.

Common mistakes

  • Putting the run over the rise instead of the rise over the run.
  • Subtracting x values in one order and y values in the other.
  • Reporting a vertical line as having a slope of 0.
  • Forgetting to square both differences when finding distance.

Assumptions and limits

  • The two points are distinct and use real numbers.
  • The coordinate plane is standard, with y up and x to the right.
  • The angle is measured from the positive x-axis.
  • Both axes use the same scale for a physical angle.
  • Displayed values are rounded for readability.

Frequently asked questions

What does a negative slope mean?

The line falls as it moves right. Each unit increase in x lowers y by the absolute value of the slope.

What is the slope of a horizontal line?

Zero. The y value does not change, so the rise is 0. The equation has the form y = b.

Why is a vertical line's slope undefined?

Slope divides the change in y by the change in x, and a vertical line has no change in x. Dividing by zero is undefined, so the line is written as x = c.

How do I find the y-intercept?

Use b = y1 - m x x1 with either point. For a slope of 2 through (1, 2), b = 2 - 2 x 1 = 0.

What angle does a slope of 1 make?

45 degrees. The arctangent of 1 is 45, and a slope of -1 gives -45 degrees.

Can the slope be a fraction?

Yes. A rise of 1 and a run of 3 gives a slope of 1/3, about 0.3333. Keeping the fraction is more exact than rounding.

Sources

This calculator is an educational math tool. Results are rounded and assume two distinct points on a standard coordinate plane. Confirm the equation and units before using the output for engineering or graded work.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Go deeper

Guides that explain the math

Slope Calculator: Rise, Run, and What the Number Means
Math

Slope Calculator: Rise, Run, and What the Number Means

Slope as rise over run: worked examples, horizontal and vertical lines, grade versus degrees, and the sign errors that flip the answer.

7 min read

Calccc Editorial Team · Updated 2026-11-12

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.