🧮
🧮 Math & statistics

Slope Calculator (from two points: slope, angle, line equation)

Results update as you type.

Your numbers

Understanding the slope calculator — concept and principle

This calculator finds the slope of the line through two points, its equation, the angle of inclination, the grade in percent, the y-intercept, the perpendicular slope and the distance between the points. Use it for algebra and coordinate geometry, for ramps, roofs and roads, and for reading rates of change from data.

Slope from two pointsRise over runrun 4rise 8(1, 2)(5, 10)m = 8 ÷ 4 = 2y = 2xangle 63.43°grade 200%perpendicular −0.5
From (1, 2) to (5, 10) the line rises 8 while running 4, so the slope is 2.

How it is calculated

A vertical line (x₁ = x₂) has no defined slope; a horizontal line has slope 0.

The principle

A straight line rises by the same amount for every unit it moves to the right, and that constant rate is the slope. Any two points on the line give the same ratio, because the triangles formed by rise and run are similar. The slope is the tangent of the angle the line makes with the x-axis. Two lines are perpendicular when the product of their slopes is −1, since turning a direction by 90° swaps rise and run and changes one sign.

Worked example

Default inputs: (1, 2) and (5, 10).

  1. Rise Δy = 10 − 2 = 8; run Δx = 5 − 1 = 4.
  2. Slope m = 8 ÷ 4 = 2.
  3. b = 2 − 2 × 1 = 0, so the equation is y = 2x.
  4. Angle = arctan 2 ≈ 63.43494882°; grade = 200%.
  5. Perpendicular slope = −0.5; distance = √(4² + 8²) = √80 ≈ 8.94427191.
How Slope m changes with x₂How Slope m changes with x₂0102030401.252.53.7556.257.510Example: 2x₂
Each point is the calculator re-run with only “x₂” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
x₂Slope m
1.2532
2.55.333333333
3.752.909090909
52
6.251.523809524
7.51.230769231
100.8888888889

How to read the result

A positive slope rises from left to right; a negative slope falls. The size tells you how steep: slope 1 is 45°, slope 2 is about 63°. Grade is how roads and ramps are usually described: a 200% grade is very steep, while road grades are usually a few percent. In data, the slope is the change in y per unit of x, with units such as km per hour.

Common mistakes

Keep in mind: For ramps, stairs, roofs and roads, maximum slopes are set by building codes and accessibility rules. Check the local requirements and consult a qualified professional for real designs.

Frequently asked questions

How do I convert slope to degrees?

Take the arctangent: angle = arctan(m). Slope 1 is 45°.

What is the slope of a horizontal line?

0, because the rise is zero.

What does a slope of −0.5 mean?

The line drops 0.5 units for every 1 unit to the right.

Sources: OpenStax, College Algebra 2e, §4.1 Linear Functions

Checked 9 Nov 2026. Analytic geometry of the straight line (e.g. OpenStax College Algebra 2e, §4.1 Linear functions: slope, point-slope and slope-intercept forms).

🧮 All math & statistics tools →🌍 Calculators by country →