Slope Calculator

Find the slope of a line through two points, with the equation in slope-intercept, point-slope and standard form, plus the angle, percent grade, distance and midpoint

Last updated: November 25, 2026

How to Use the Slope Calculator

How to use the slope calculator

  1. Enter the first point as x₁ and y₁.
  2. Enter the second point as x₂ and y₂. Negative numbers and decimals work.
  3. Read the results. You get the slope as a fraction and a decimal, the equation of the line in slope-intercept, point-slope and standard form, the x- and y-intercepts, the angle, the percent grade, the distance between the points and the midpoint.
  4. Check the working to see each step of the slope formula, which is useful for homework.

The order of the points does not matter. Swapping them gives the same slope, because both the rise and the run change sign.

Formula & Methodology

The slope formula

The slope of a line measures how steep it is: how much it rises (or falls) for each step to the right. For two points (x₁, y₁) and (x₂, y₂):

m = (y₂ − y₁) ÷ (x₂ − x₁)

This is often called rise over run: the change in y divided by the change in x.

Worked example

Find the slope through (2, 5) and (6, 13):

  1. Rise: 13 − 5 = 8
  2. Run: 6 − 2 = 4
  3. Slope: m = 8 ÷ 4 = 2

The line rises 2 units for every 1 unit it moves to the right.

The equation of the line

Once you have the slope, find the y-intercept b, where the line crosses the y-axis, using either point:

b = y₁ − m × x₁ = 5 − 2 × 2 = 1

The line can then be written in three common forms:

  • Slope-intercept form: y = mx + b, so y = 2x + 1
  • Point-slope form: y − y₁ = m(x − x₁), so y − 5 = 2(x − 2)
  • Standard form: Ax + By = C with whole numbers, so 2x − y = −1

Types of slope

  • Positive slope: the line goes up from left to right.
  • Negative slope: the line goes down from left to right.
  • Zero slope: a horizontal line, such as y = 4.
  • Undefined slope: a vertical line, such as x = 3, because the run is zero and you cannot divide by zero.

Angle and percent grade

The angle a line makes with the x-axis is θ = arctan(m). A slope of 1 is a 45° angle. The percent grade, used for roads, ramps and roofs, is the slope × 100, so a slope of 0.08 is an 8% grade.

Distance and midpoint

  • Distance: d = √((x₂ − x₁)² + (y₂ − y₁)²). For the example, √(4² + 8²) = √80 ≈ 8.944.
  • Midpoint: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) = (4, 9).

About Slope Calculator

Our slope calculator is a free, easy-to-use tool designed to help youfind the slope of a line through two points, with the equation in slope-intercept, point-slope and standard form, plus the angle, percent grade, distance and midpoint. If you're a professional or just need quick calculations, our calculator provides accurate results instantly.

Frequently Asked Questions

How do you find the slope from two points?

Subtract the y-values and divide by the difference of the x-values, in the same order: m = (y₂ − y₁) ÷ (x₂ − x₁). For (1, 2) and (4, 11), the slope is (11 − 2) ÷ (4 − 1) = 9 ÷ 3 = 3.

What is slope-intercept form?

It is y = mx + b, where m is the slope and b is the y-intercept, the point where the line crosses the y-axis. In y = 2x + 1, the slope is 2 and the line crosses the y-axis at (0, 1).

What does a negative slope mean?

The line falls as you move from left to right. Every step to the right takes the line down. For example, a slope of −3 means the line drops 3 units for each unit it moves right.

What is the slope of a vertical or horizontal line?

A horizontal line has a slope of 0, because y does not change. A vertical line has an undefined slope, because x does not change and the formula would divide by zero.

How do you convert slope to an angle?

Take the inverse tangent: angle = arctan(m). A slope of 1 is 45°, a slope of 0.5 is about 26.57°, and a slope of 2 is about 63.43°.

What is percent grade?

Percent grade is the slope written as a percentage: rise ÷ run × 100. A road that climbs 6 feet over 100 feet of horizontal distance has a 6% grade. It is common for roads, wheelchair ramps and drainage.

Does it matter which point is first?

No. If you swap the points, both the rise and the run change sign, so their ratio, the slope, stays the same. Just keep the order consistent for the top and bottom of the fraction.

Enter your values

First point (x₁, y₁)

Second point (x₂, y₂)

Your result will appear here

Loading…