Slope Calculator

Find the slope and angle of a line from two points.

How it is calculated

The slope is rise over run between two points: m = (y₂ − y₁) ÷ (x₂ − x₁). The angle the line makes with the horizontal axis is θ = arctan(m) in degrees, so it always lies between −90° and 90°: a rising line gives a positive angle and a falling line a negative one. Enter both coordinates of both points; any empty box gives no result. If x₁ equals x₂ the line is vertical, the division would be by zero, and the tool shows no result instead of printing "undefined". Slope and angle are rounded to two decimals. A horizontal line returns 0.00. The slope has no unit if both axes use the same unit.

Worked example

Take the points (1, 2) and (5, −6). Rise: −6 − 2 = −8. Run: 5 − 1 = 4. Slope: −8 ÷ 4 = -2.00, so the line falls 2 units for every 1 unit to the right. Angle: arctan(−2) = -63.43°, which means the line points downward at about 63 degrees below the horizontal. Swapping the order of the two points gives the same slope, because both the rise and the run change sign.

Try this example →

Common mistakes

  • Subtracting in a different order on top and bottom, such as y₂ − y₁ over x₁ − x₂. This flips the sign, so a falling line looks like a rising one.
  • Putting run over rise. The slope is vertical change divided by horizontal change, so a steep line has a large number, not a small one.
  • Entering a vertical line (same x for both points) and expecting an answer. The slope is undefined there and the tool shows nothing, so change one x or treat the line as x = constant.
  • Reading the angle as a road grade. A slope of 0.10 is a 10 % grade, but its angle is only about 5.71°, not 10°.
  • Using axes with different units, such as time in minutes and distance in metres, and then reading the angle as a real-world steepness. The slope is meaningful, but the angle depends on how the two axes are scaled.

About this calculator

The slope of a line through two points (x₁,y₁) and (x₂,y₂) measures how steeply it rises or falls: m = (y₂ − y₁) / (x₂ − x₁), often described as “rise over run.” A positive slope climbs left to right, a negative slope descends, a slope of 0 is perfectly horizontal, and an undefined slope (division by zero) marks a vertical line. The angle the line makes with the horizontal follows from it directly: θ = arctan(m).

Slope is one of the most widely applied ideas in coordinate geometry precisely because “rate of change” shows up everywhere: physicists read it as velocity on a position-time graph or acceleration on a velocity-time graph, economists read it as marginal cost or marginal rate on a supply/demand curve, and civil engineers use it directly to specify road grades and roof pitches. Accessibility standards like the ADA even define maximum allowable ramp slopes in exactly these rise-over-run terms.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators