Slope Calculator: Slope, Angle and Equation of a Line

Enter two points on the line. You get the slope (gradient), the angle it makes with the x-axis, the intercepts and the line's equation.

Slope (m)

1.5

Equation
y = 1.5x + 0.5
Angle with x-axis
56.3099 °
y-intercept (c)
0.5
x-intercept
−0.3333

As a fraction m = 3/2; general form: 3x − 2y + 1 = 0.

Show working
  1. m = (y₂ − y₁) / (x₂ − x₁)
  2. m = (8 − 2) / (5 − 1) = 6 / 4 = 1.5
  3. c = y₁ − m·x₁ = 2 − 1.5 × 1 = 0.5
  4. y = 1.5x + 0.5
  5. θ = tan⁻¹(m) = 56.3099°

How to use

  1. Enter the first point (x₁, y₁).
  2. Enter the second point (x₂, y₂).
  3. Read the slope, angle and equation.

Good to know

Slope m = (y₂ − y₁) / (x₂ − x₁), the rise over the run. Its angle with the positive x-axis is θ = tan⁻¹(m), from NCERT Class 11 "Straight Lines". A positive slope rises to the right, a negative one falls.

The line's equation in slope-intercept form is y = mx + c, where c = y₁ − m·x₁ is where the line crosses the y-axis. With whole-number points the calculator also gives the slope as a fraction and the general form ax + by + c = 0.

If x₁ = x₂ the line is vertical: its slope is undefined and its equation is x = constant. A horizontal line has slope 0. Parallel lines have equal slopes; perpendicular lines have slopes that multiply to −1.

Questions

What is the slope formula?

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

What is the slope of a vertical line?

Undefined, because x₂ − x₁ = 0. Its equation is x = a constant.

How do I find the angle of a line?

θ = tan⁻¹(m). A slope of 1 means 45°.

How do I tell if two lines are perpendicular?

Multiply their slopes. If the product is −1 (and neither line is vertical), they are perpendicular.

Is anything I enter stored?

No. The calculation runs in your browser and nothing is sent to a server.

Last updated: