Math

Slope Calculator

Compute the slope of the line through two points, plus its angle with the x-axis, with a worked example and special cases for vertical and horizontal lines.

Inputs

Results update as you type — essentials first

Saved scenarios

Store input snapshots on this device — load anytime.

No saved scenarios yet.

Formula / how it works

Slope m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run. Angle with the x-axis θ = arctan(m). A vertical line (x₁ = x₂) has undefined slope.

Detailed guide

What it is, how to use it, how to read the numbers, common mistakes, a worked example, formulas, and FAQs.

What this calculator is

Slope describes how steep a line is: how many units it rises (or falls) vertically for each unit it runs horizontally. A slope of 2 means that for every 1 unit you move right, you go up 2. Positive slopes rise to the right, negative slopes fall, and zero slope is a horizontal line. This calculator takes two points and returns the slope and the angle the line makes with the positive x-axis. It is used in algebra, in graphing, in road and roof grades, and in analysing trends. A vertical line has no defined slope because the run is zero.

When to use / who it helps

  • You need the steepness of a line through two points.
  • You are finding the equation of a line.
  • You are checking if two lines are parallel or perpendicular.
  • You are converting a grade or pitch into an angle.
  • You are analysing the trend between two data points.

How to use

Steps

  1. Enter x₁ and y₁ for the first point.
  2. Enter x₂ and y₂ for the second point.
  3. Read the slope m.
  4. Read the angle in degrees.
  5. Use y − y₁ = m(x − x₁) to write the line equation.
  6. Check that x₁ and x₂ are not equal.

How to interpret results

  • Positive slope: the line goes up to the right; negative: down to the right.
  • Zero slope is horizontal.
  • Parallel lines share the same slope; perpendicular lines have slopes whose product is −1.
  • The angle is measured from the positive x-axis.
  • The scale of the axes affects how steep a graph looks, not the slope value.

Common mistakes & gotchas

  • Subtracting in a different order for x and y.
  • Dividing run by rise.
  • Using a vertical line and expecting a number.
  • Mixing units on the two axes.
  • Confusing slope with percentage grade.

Worked example

Worked example — points (1, 2) and (4, 8)

  1. Rise: 8 − 2 = 6.
  2. Run: 4 − 1 = 3.
  3. Slope: 6 ÷ 3 = 2.
  4. Angle: arctan(2) ≈ 63.43°. A perpendicular line would have slope −1/2.

Result: The slope is 2, and the line makes an angle of about 63.43° with the x-axis.

To load the form's own demo values, tap Try example above the Calculate button.

How to calculate / formula

Slope m = (y₂ − y₁) ÷ (x₂ − x₁) = rise ÷ run. Angle with the x-axis θ = arctan(m). A vertical line (x₁ = x₂) has undefined slope.

Frequently asked questions

What is the slope formula?

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

What is the slope of a vertical line?

Undefined, because the run is zero.

How do I find the angle from the slope?

Take the inverse tangent of the slope.

How do I find a perpendicular slope?

Take the negative reciprocal: −1 ÷ m.

How is slope related to percent grade?

Percent grade is slope times 100, so a slope of 0.05 is a 5% grade.

Does the order of the points matter?

Not if you subtract in the same order for both coordinates.