CalcUnit Logo

How to Calculate Slope

Find the slope of a line between two points.

The Formula

m = (y₂-y₁)/(x₂-x₁)

The slope formula uses the mathematical relationship: m = (y₂-y₁)/(x₂-x₁). Each variable in the formula represents a measurable quantity that affects the final result.

What Each Variable Means

Every value in the slope formula, what it measures, and the value used in the worked example on this page:

VariableTypeExample value
Point 1 — X₁Input (you provide)0
Point 1 — Y₁Input (you provide)0
Point 2 — X₂Input (you provide)4
Point 2 — Y₂Input (you provide)8
Slope (m)Result (calculated)—
Y-Intercept (b)Result (calculated)—
Distance Between PointsResult (calculated)—
Angle (degrees)Result (calculated)—

Step-by-Step Method

  1. 1Write down the values you know: Point 1 — X₁, Point 1 — Y₁, Point 2 — X₂, Point 2 — Y₂.
  2. 2Substitute your known values into the formula: m = (y₂-y₁)/(x₂-x₁).
  3. 3Work through the arithmetic in the standard order of operations — parentheses first, then exponents, then multiplication and division, then addition and subtraction.
  4. 4Check that your result carries the correct unit and falls in a reasonable range for the problem.
  5. 5Verify your answer with the interactive Slope Calculator — it solves the same formula instantly.

Worked Example

Take a concrete case: point 1 — x₁ = 2, with the other inputs at the typical values from the variables table above. Substituting into the formula gives slope (m) = 4.000000, y-intercept (b) = -8.000000, distance between points = 8.2462, angle (degrees) = 75.96. These numbers are solved by the same engine that powers the Slope calculator, so you can reproduce them exactly by entering the same inputs there.

Point 1 — X₁Slope (m)Y-Intercept (b)Distance Between PointsAngle (degrees)
12.666667-2.6666678.544069.44
24.000000-8.0000008.246275.96
5-8.00000040.0000008.0623-82.87
10-1.33333313.33333310.0000-53.13
20-0.50000010.00000017.8885-26.57
50-0.1739138.69565246.6905-9.87
100-0.0833338.33333396.3328-4.76
250-0.0325208.130081246.1300-1.86
500-0.0161298.064516496.0645-0.92
1,000-0.0080328.032129996.0321-0.46

How each result changes as point 1 — x₁ changes, holding the other inputs constant.

Practice Problems

1. Positive slope: With Point 1 — X₁ 0, Point 1 — Y₁ 0, Point 2 — X₂ 4, Point 2 — Y₂ 8, what are the results?

Answer: Entering Point 1 — X₁ 0, Point 1 — Y₁ 0, Point 2 — X₂ 4, Point 2 — Y₂ 8 gives Slope (m) 2.000000, Y-Intercept (b) 0.000000, Distance Between Points 8.9443, Angle (degrees) 63.43°.

2. Negative slope: Point 1 — X₁ 0, Point 1 — Y₁ 5, Point 2 — X₂ 5, Point 2 — Y₂ 0 — work it out, then check the answer.

Answer: The calculator returns Slope (m) -1.000000, Y-Intercept (b) 5.000000, Distance Between Points 7.0711, Angle (degrees) -45.00° for Point 1 — X₁ 0, Point 1 — Y₁ 5, Point 2 — X₂ 5, Point 2 — Y₂ 0.

Frequently Asked Questions

What is the formula for slope?

The formula is: m = (y₂-y₁)/(x₂-x₁). Find the slope of a line between two points.

What values do I need to calculate slope?

You need point 1 — x₁, point 1 — y₁, point 2 — x₂, point 2 — y₂. The calculator produces slope (m), y-intercept (b), distance between points, angle (degrees) from those inputs.

What is the slope when point 1 — x₁ is 2?

With point 1 — x₁ = 2, the result is slope (m) = 4.000000, y-intercept (b) = -8.000000, distance between points = 8.2462, angle (degrees) = 75.96. This is worked through in full in the example on this page.

Related Topics

slopegradientlinealgebra

Use the Interactive Calculator

Skip the manual math — get instant results with our free Slope calculator.

Open Calculator

Related Calculators