Slope Calculator

Find the slope, angle, distance, midpoint, and line equation from two coordinate points.

Two Points

Point 1: (2, 3)
Point 2: (7, 11)
Line Equation
y = 1.6x − 0.2
Slope (m)
1.6
Angle (θ)
57.9946°
FormulaExpression
Slopem = (y₂ − y₁) / (x₂ − x₁)
Distanced = √((x₂−x₁)² + (y₂−y₁)²)
MidpointM = ((x₁+x₂)/2, (y₁+y₂)/2)
y-interceptb = y₁ − m·x₁
Angleθ = arctan(|m|)

Results

PropertyValue
Slope (m)1.6
y-intercept (b)-0.2
Line Equationy = 1.6x − 0.2
Angle (θ)57.9946°
Distance (d)9.433981
Δx (run)5
Δy (rise)8
Midpoint(4.5, 7)
Perpendicular slope-0.625

Slope Types

TypeSlope (m)Description
Positivem > 0Rises left to right
Negativem < 0Falls left to right
Zerom = 0Horizontal line
Undefined—Vertical line (Δx = 0)

Slope and angle describe the same tilt in two different languages, and mixing them up is how a 45 percent grade gets pictured as a 45-degree cliff. A 45 percent grade is a slope of 0.45, which is an angle of only 24.2277°. Give this calculator two points and it shows both versions, plus the line equation, distance, midpoint and perpendicular slope.

From two points to a line equation

Use the preloaded points (2, 3) and (7, 11). First find the run and the rise: Δx = 7 − 2 = 5 and Δy = 11 − 3 = 8.

The slope is rise over run, m = (y₂ − y₁) / (x₂ − x₁), so m = 8 / 5 = 1.6.

The y-intercept follows from b = y₁ − m × x₁ = 3 − 1.6 × 2 = −0.2, and the page assembles the two into y = 1.6x − 0.2.

The angle is θ = arctan(|m|) = arctan(1.6) = 57.9946°. The distance is √(5² + 8²) = √89 = 9.433981, and the midpoint is ((2 + 7) / 2, (3 + 11) / 2) = (4.5, 7).

The perpendicular slope is the negative reciprocal, −1 / 1.6 = −0.625. Slopes and distances are rounded to six decimals and the angle to four.

How to Use This Calculator

  1. Type x₁ and y₁ for the first point, and x₂ and y₂ for the second. Negative and decimal values are fine.
  2. Read the line equation and slope in the top panel.
  3. Check the results table for the y-intercept, angle, distance, run, rise, midpoint and perpendicular slope.
  4. For a vertical line, expect undefined for the slope and y-intercept, and an equation of the form x = number.

Frequently Asked Questions

Why does it say the slope is undefined?

When x₁ equals x₂, the run is zero and dividing by zero is not allowed, so the line is vertical. The page then shows an angle of 90° and a perpendicular slope of 0. Entering exactly the same point twice is reported as vertical too, although a single point does not define any line.

Why is the angle always positive, even for a falling line?

The page computes arctan of the absolute slope, so it reports the steepness without the direction. A slope of −2 shows 63.4349°. The angle the line makes measured from the positive x-axis would be 116.565°, which you can get by subtracting 63.4349 from 180.

Does the order of the points matter?

Only if you mix them up. Swapping both points entirely gives the same slope, 1.6 in the example. But swapping just the y-values, entering (2, 11) and (7, 3), flips the slope to −1.6.

How do I turn the slope into a percent grade or roof pitch?

Multiply by 100 for a percent grade, so 1.6 is a 160 percent grade. A roof pitch of 6 in 12 is a slope of 0.5, which is an angle of about 26.57°.

Why does a slope of 1/3 show as 0.333333?

Slope is rounded to six decimal places, and the line equation is built from the rounded value. For exact fractions, work out rise over run yourself from the Δy and Δx rows. For long decimals, treat the displayed intercept as approximate.