Slope Calculator

Quick answer

A slope calculator finds how steep a line is between two points, as rise over run. Enter the coordinates of both points and it returns the slope, the y-intercept, and the line equation. From (1, 2) to (3, 8) the slope is 3.

Updated 2026-09-09By Shakeel MuzaffarReviewed by Prof. Dr. Khalil Mudassar, PhD
Try
Coordinate Geometry
The x coordinate of the first point.
The y coordinate of the first point.
The x coordinate of the second point.
The y coordinate of the second point.
Slope (m)
--
Y-intercept (b)--
Line equation--

Calculations run in your browser. Inputs are not sent to our servers; anything you Save stays in this browser only.

Saved results (0)

How to Use the Slope Calculator

  1. Enter the x and y of the first point.
  2. Enter the x and y of the second point.
  3. Read the slope, the rise over the run between them.
  4. See the y-intercept and the full line equation.

Here is what each result means:

ResultWhat it means
SlopeHow steep the line is, rise divided by run.
Y-interceptWhere the line crosses the y-axis.
Line equationThe line written as y = m x + b.

What Is Slope?

Slope measures how steep a straight line is. It is the ratio of the vertical change to the horizontal change between two points, often described as rise over run. A slope of 3 means the line goes up 3 units for every 1 unit across.

The sign tells you the direction. A positive slope rises from left to right, a negative slope falls, a zero slope is a flat horizontal line, and a vertical line has an undefined slope because the run is zero. Slope is a core idea in algebra, physics and any field that deals with rates of change.

How Does the Slope Calculator Work?

It divides the change in y by the change in x, then finds the intercept and equation.

Formula: m = (y2 - y1) / (x2 - x1)
  1. Subtract the y values for the rise, and the x values for the run.
  2. Divide rise by run to get the slope.
  3. Use a point and the slope to find the intercept and the equation.

The straight-line distance between the same two points is a right-triangle problem; see the Pythagorean theorem calculator.

Slope Example

Find the slope of the line through (1, 2) and (3, 8).

Calculation: m = (8 - 2) / (3 - 1) = 6 / 2 = 3. The line rises 3 for every 1 across. Using the point (1, 2), the intercept is b = 2 - 3(1) = -1, so the equation is y = 3x - 1.

Positive vs Negative vs Zero Slope

The value and sign of the slope describe the line at a glance.

SlopeLineExample
PositiveRises left to rightm = 2
NegativeFalls left to rightm = -0.5
ZeroFlat, horizontalm = 0
UndefinedVertical linex is constant

A larger size of slope means a steeper line, whether it rises or falls.

Slope in the Line Equation

Slope is one half of the most common way to write a line.

FormEquationReads off
Slope-intercepty = m x + bSlope m and intercept b
Point-slopey - y1 = m(x - x1)Slope and one point

Once you have the slope and any point, you can write the line in either form and convert between them.

What Affects the Slope

The Order of the Points

Subtract the coordinates in the same order for both x and y. Reversing only one flips the sign.

The Run Being Zero

If the two x values match, the run is zero and the slope is undefined, since you cannot divide by zero.

The Scale of the Axes

Slope is a pure ratio, but a stretched axis can make a line look steeper than its slope suggests.

When to Use a Slope Calculator

Graphing Lines

Find the slope and intercept to plot a line or write its equation.

Rates of Change

Read a rate, such as speed or cost per unit, from two data points.

Construction and Design

Work out a gradient or pitch, such as a ramp or roof, as rise over run.

Common Mistakes

1. Mixing Up the Order

Keep the same point first in both the top and bottom of the fraction, or the sign flips.

2. Flipping Rise and Run

Slope is rise over run, not run over rise. The vertical change goes on top.

3. Calling a Vertical Slope Zero

A vertical line has an undefined slope, not zero. Zero slope is a horizontal line.

4. Sign Errors with Negatives

Subtracting a negative coordinate adds. Track the signs carefully.

5. Using the Same Point Twice

Two identical points do not define a line. Use two different points.

Accuracy and Limitations

The slope formula is exact; only the displayed decimals are rounded.

What it calculates accurately

  • The slope between two points
  • The y-intercept and line equation
  • The angle the line makes

What it does not do

  • Give a slope for a vertical line
  • Fit a line to more than two points
  • Handle curves or nonlinear data
  • Draw the line to scale

How We Find Your Slope

Method
Change in y over change in x, then the intercept from a point, then the equation.
Inputs used
The coordinates of two points.
Assumptions
A straight line through two distinct points.
Rounding
Slope, intercept and angle to four decimals.
Edge cases
Equal x values give an undefined slope; identical points define no line.
Sources
See Sources below.
Last reviewed
2026-09-08.

Frequently Asked Questions

How do you find the slope between two points?

Subtract the y values for the rise, subtract the x values for the run, then divide rise by run. From (1, 2) to (3, 8), the slope is (8 - 2) over (3 - 1), which is 3.

What is rise over run?

It is the definition of slope: the vertical change, the rise, divided by the horizontal change, the run, between two points on a line. A rise of 6 over a run of 2 is a slope of 3.

What does a negative slope mean?

A negative slope means the line falls from left to right, going down as x increases. The steeper the fall, the larger the size of the negative slope.

What is the slope of a horizontal line?

Zero. A horizontal line has no vertical change, so the rise is zero and the slope is zero. Its equation is y equals a constant.

Why is a vertical line slope undefined?

A vertical line has the same x at every point, so the run is zero. Dividing the rise by a zero run is undefined, which is why a vertical slope has no value.

How do I find the y-intercept from the slope?

Use a known point and the slope in y equals m x plus b. Substitute the point and slope, then solve for b. This tool does it and shows the full equation.

What is the slope-intercept form?

It is y equals m x plus b, where m is the slope and b is the y-intercept. It is the most common way to write a straight line, since both values read off directly.

Does the order of the points matter?

The line is the same either way, but you must subtract the coordinates in the same order for x and y. Reversing only one of them flips the sign of the slope.

Is my information saved?

No. The calculation runs in your browser and nothing you enter is stored or sent anywhere, unless you choose Save, which keeps the result only on this device.

Sources

Related Guides

Related Calculators

Looking for more math tools?

Explore all math calculators

This calculator finds the slope of the straight line through two points. A vertical line, where the two x values match, has an undefined slope. Results are rounded for display. Spotted an error? Let us know.

Author

shakeel-Muzaffar
Founder & Editor-in-Chief at  ~ Web ~  More Posts

Shakeel Muzaffar is the Founder and Editor-in-Chief of MultiCalculators.com, bringing over 15 years of experience in digital publishing, product strategy, and online tool development. He leads the platform's editorial vision, ensuring every calculator meets strict standards for accuracy, usability, and real-world value. Shakeel personally oversees content quality, formula verification workflows, and the platform's commitment to publishing tools that are genuinely useful for students, professionals, and everyday users worldwide.