Slope Calculator

Enter two points (x₁, y₁) and (x₂, y₂) to get the slope, the line equation in slope-intercept form, the angle, the distance and the midpoint.

  • Runs on your device
  • Keyboard-first
  • Free, no sign-up

Point 1

Point 2

Slope (m)

—

Line equation
—
Angle
—
Distance
—
Midpoint
—
Rise / run
—

Calculated on your device. Nothing you type is sent anywhere.

Cite
APA: Mr. Behairy. (2026). Slope Calculator. Anubis Calc. https://calculatoranubis.com/en/slope-calculator
MLA: Mr. Behairy. "Slope Calculator." Anubis Calc, 2026, https://calculatoranubis.com/en/slope-calculator.
Embed

Copy this snippet to embed this calculator on your site or blog for free:

<iframe src="https://calculatoranubis.com/en/embed/slope-calculator" width="100%" height="520" style="border:0;border-radius:18px" loading="lazy" title="Slope Calculator"></iframe>
<p><a href="https://calculatoranubis.com/en/slope-calculator" rel="noopener">Slope Calculator — Anubis Calc</a></p>

How it works

The slope of a line measures how steep it is: how much y changes for each step in x, often described as “rise over run”. A positive slope climbs to the right, a negative one falls, zero is flat and a vertical line has no defined slope.

slope m = (y₂ − y₁) ÷ (x₂ − x₁)  ·  intercept b = y₁ − m × x₁  ·  y = mx + b angle = arctan(m)  ·  distance = √((x₂ − x₁)² + (y₂ − y₁)²)  ·  midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)

Worked example. Points (1, 2) and (4, 6): rise = 4, run = 3, so m = 4/3 ≈ 1.333333. b = 2 − 4/3 × 1 = 0.666667, giving y = 1.333333x + 0.666667. The angle is 53.13°, the distance is √(9 + 16) = 5 and the midpoint is (2.5, 4).

Reading a slope

SlopeAngleGrade
00°Flat
0.052.86°5% — typical wheelchair ramp maximum is 8.33%
0.526.57°50%
145°100%
Undefined90°Vertical

Parallel and perpendicular lines

  • Parallel lines have equal slopes.
  • Perpendicular lines have slopes whose product is −1: the perpendicular to m = 4/3 has slope −3/4.

Slope in real life

Road signs give slope as a percentage grade (rise ÷ run × 100). Roofers use pitch, such as 6/12 — 6 inches of rise per 12 of run, a slope of 0.5. Accessibility rules in many countries limit ramps to 1:12 (8.33%).

Solving equations? The quadratic formula calculator handles ax² + bx + c = 0. For fractions in your slope, try the fraction calculator, and for proportional problems the rule of three.

Sources & assumptions

Cartesian coordinates; angle measured from the positive x-axis; results rounded to six decimals.

Reviewed by: Mr. Behairy (Accountant, Financial Auditor & Tax Specialist) · Editorial policy · Formulas reviewed:

Frequently asked questions

How do I find the slope from two points?

Divide the change in y by the change in x: (6 − 2) ÷ (4 − 1) = 4/3.

What is the slope of a horizontal line?

Zero, because y does not change.

What is the slope of a vertical line?

Undefined, because the change in x is zero.

How do I write the equation of a line?

Find the slope m, then b = y₁ − m × x₁, and write y = mx + b.

How do I convert slope to an angle?

Take the arctangent: a slope of 1 is 45°.

What is the slope as a percentage?

Multiply the slope by 100. A slope of 0.05 is a 5% grade.