Skip to content
FiftyCalc Free calculators for all 50 states

Slope Calculator

Test cases replayed : 2 of 2 match · Methodology · No outside source listed

Enter two points to get the slope, the line equation's intercept, the distance and the midpoint.

Result

Sample figures

Slope m (rise ÷ run)—

y-intercept b (y = mx + b) —

  • Distance between the points—
  • Midpoint x—
  • Midpoint y—
  • Angle of the line (degrees from the x-axis)—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Slope Calculator

x₁: enter a number. Prefilled example: 1.

y₁: enter a number. Prefilled example: 2.

x₂: enter a number. Prefilled example: 4.

y₂: enter a number. Prefilled example: 8.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. x₁: enter a number.
  2. y₁: enter a number.
  3. x₂: enter a number.
  4. y₂: enter a number.
  5. Read the result: Slope m (rise ÷ run); the panel also shows y-intercept b (y = mx + b), Distance between the points, Midpoint x, Midpoint y and Angle of the line (degrees from the x-axis).

How this calculator works

Slope m = (y₂ − y₁) ÷ (x₂ − x₁); intercept b = y₁ − m × x₁. Distance = √((x₂ − x₁)² + (y₂ − y₁)²); midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).

A vertical line (x₁ = x₂) has an undefined slope, shown as a dash.

The formula

  1. M=y2−y1x2−x1
Symbols used in the formula
SymbolMeaning
x1x₁
y1y₁
x2x₂
y2y₂
MSlope m (rise ÷ run)

Worked example

x₁1
y₁2
x₂4
y₂8
y-intercept b (y = mx + b)0
Distance between the points6.7082
Midpoint x2.5
Midpoint y5
Angle of the line (degrees from the x-axis)63.4349
  1. M=8−24−1=2

Slope m (rise ÷ run) 2

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

How do you find slope from two points?

Divide the change in y by the change in x. From (1, 2) to (4, 8): (8 − 2) ÷ (4 − 1) = 2.

What does a negative slope mean?

The line goes down from left to right.

Related calculators