Slope Calculator

Enter two points to get the slope of the line through them, its equation in three forms, the intercepts, the angle and the distance, or start from one point and a slope.

Your results

–

Save this calculation and come back to it any time. Members only — $5 every 3 months, ad-free.

Become a member

How to use the slope calculator

  1. Choose whether you know two points or a point and the slope.
  2. Enter the first point (x₁, y₁).
  3. Enter the second point (x₂, y₂), or the slope m.
  4. Read the slope (or the equation) at the top, then the slope-intercept, point-slope and standard forms, the intercepts, the angle with the x-axis and, for two points, the distance and midpoint.

With whole numbers or short decimals, the slope and intercept are shown as exact fractions, such as 1/3, with the decimal beside them.

The slope formula

m = (y₂ − y₁) / (x₂ − x₁) = rise / run Slope-intercept y = mx + b, where b = y₁ − m·x₁ Point-slope y − y₁ = m(x − x₁) Standard Ax + By = C Angle θ = arctan(m)

The slope is the rise (the change in y) divided by the run (the change in x). A positive slope climbs from left to right, a negative slope falls, a slope of 0 is a horizontal line, and a vertical line has no slope at all because its run is 0. The y-intercept b is where the line crosses the y-axis. Standard form uses whole numbers with no common factor and a positive x coefficient, so it is easy to compare two lines.

Worked example

The calculator starts with the points (2, 3) and (6, 11).

  1. Rise: 11 − 3 = 8.
  2. Run: 6 − 2 = 4.
  3. Slope: m = 8 ÷ 4 = 2.
  4. y-intercept: b = 3 − 2 × 2 = −1, so the line is y = 2x − 1.
  5. Point-slope form: y − 3 = 2(x − 2). Standard form: 2x − y = 1.
  6. Angle: arctan(2) ≈ 63.4349°. Distance: √(4² + 8²) = √80 ≈ 8.944272. Midpoint: (4, 7).

Check with the second point: 2 × 6 − 1 = 11. With (2, 3) and (5, 4) instead, the rise is 1 and the run is 3, so the slope is 1/3, about 0.333333.

Slope, angle and grade

The same steepness can be written three ways. Road signs use grade, the slope as a percentage; builders often use rise over run; maps and physics use the angle.

Slope (rise / run) Grade Angle
1/12 8.33% 4.76°
0.1 10% 5.71°
1/2 50% 26.57°
1 100% 45°
2 200% 63.43°

A 100% grade is a 45° slope, not a vertical wall. The 1/12 row is the steepest running slope allowed for a new wheelchair ramp under section 405.2 of the 2010 ADA Standards for Accessible Design: 1 inch of rise for every 12 inches of run.

Parallel and perpendicular lines

Parallel lines have the same slope. Perpendicular lines have slopes whose product is −1, so the perpendicular to a line with slope 2 has slope −1/2. Use the point and slope mode to write that line through any point: through (2, 3) with slope −0.5 the equation is y = −0.5x + 4.

Frequently asked questions

What does an undefined slope mean?

The two points have the same x value, so the run is 0 and the formula would divide by zero. The line is vertical, and its equation is just x = (that value). Its angle with the x-axis is 90°.

Does it matter which point I call the first?

No. Swapping the points flips the sign of both the rise and the run, and the two minus signs cancel. (11 − 3) ÷ (6 − 2) and (3 − 11) ÷ (2 − 6) are both 2.

How do I turn a slope into an angle?

Take the inverse tangent: θ = arctan(m). A slope of 1 is 45°, and a slope of 0.5 is about 26.57°. To go the other way, m = tan θ. The right triangle calculator works with the rise and run as the two legs.

How do I find the distance between the two points?

Use the Pythagorean theorem on the rise and the run: √(Δx² + Δy²). The calculator shows it for two points, and the distance calculator also handles 3D points and distances on the globe.

Related calculators

  • Distance Calculator — Straight-line distance between 2D or 3D points, or the great-circle distance between two places on Earth.
  • Right Triangle Calculator — Enter any two of the legs, hypotenuse, angles or area to solve a right triangle completely.
  • Quadratic Formula Calculator — Solve ax² + bx + c = 0 with exact and decimal roots, the discriminant, vertex and factored form.
  • Percentage Calculator — Percent of a number, what percent one number is of another, percentage change and difference.

Results are calculated in your browser. Double-check anything important before you rely on it. See our disclaimer.