Skip to content
Popular Calculators
Browse Math calculators

Slope Calculator

Find the slope between two points, or the angle and grade it corresponds to, along with the full equation of the line.

What do you want to work out?

About the Slope Calculator

Slope answers one question: when you move sideways, how much does the line climb?

That is all it is — a rate of change. Two units up for every one across is a slope of 2. The line is steep. Half a unit up for every one across is a slope of 0.5, and the same line looks gentle.

The idea escapes the graph paper almost immediately. On a distance-time graph the slope is speed. On a cost graph it is price per unit. On a hillside it is the gradient a cyclist feels in their legs. Anywhere one quantity changes in step with another, the slope is the number describing how fast.

This calculator works in both directions. Give it two points and it finds the slope, the angle of inclination in degrees, the percentage grade, and the equation of the line in three standard forms. Or give it an angle, a grade or a slope and it converts between the three.

How to Use the Slope Calculator

From two points. Enter the coordinates of both points: x₁, y₁ for the first and x₂, y₂ for the second. Either point can be first. Negative and decimal values are fine.

From an angle or grade. Choose what you are starting from — an angle in degrees, a percentage grade, or a slope value — and enter it. The calculator returns the other two.

Press Calculate and open the working to see each stage.

The Slope Formula

       y₂ - y₁       rise
  m = ---------  =  ------
       x₂ - x₁        run

  angle = arctan(m)          in degrees
  grade = m x 100%

The letter m is conventional and nobody is certain why. The rise is the change in y, the run is the change in x, and the slope is one divided by the other.

Both subtractions must run in the same direction. Second point minus first for the rise, second point minus first for the run. Reverse both and the two minus signs cancel, giving the same slope — which is why the order of the points does not matter, so long as you are consistent.

Why a vertical line has no slope

For a vertical line both points share the same x, so the run is zero, and dividing by zero has no value.

You will often hear "the slope is infinite". That phrasing is misleading. Infinity is not a number you could substitute into an equation, and the slope here is not a very large quantity — it is no quantity at all. The honest statement is that a vertical line's slope is undefined, and the line is written as x = a constant instead of y = mx + b.

This calculator says undefined rather than printing a number, because a number would be wrong.

Slope, Angle and Grade Are the Same Thing

Three units describe one property, and mixing them up is the most common confusion in the whole topic.

| Slope | Angle | Grade | In words | |-------|-------|-------|----------| | 0 | 0° | 0% | flat | | 0.08 | 4.57° | 8% | a steep road sign | | 0.5 | 26.57°| 50% | noticeably steep | | 1 | 45° | 100% | equal rise and run | | 2 | 63.43°| 200% | very steep | | — | 90° | — | vertical, no slope |

Read the table and the point announces itself: a 100% grade is 45 degrees, not vertical. People reasonably assume a percentage tops out at 100, so a 100% grade sounds like the maximum possible steepness. It is not. Grade is rise divided by run expressed as a percentage, and there is no ceiling — a 200% grade is perfectly describable, and a vertical face has no grade at all.

This is why the steepest road signs you will ever see say something like 25% or 30%. A 30% grade is about 17 degrees and already difficult to walk up.

Step-by-Step Example

Find the slope through (1, 2) and (4, 8).

Step 1 — rise. 8 − 2 = 6.

Step 2 — run. 4 − 1 = 3.

Step 3 — divide. m = 6 ÷ 3 = 2.

Step 4 — the other units. arctan(2) = 63.43°, and 2 × 100 = a 200% grade.

Step 5 — the equation. With m = 2 through (1, 2), the intercept is b = 2 − 2(1) = 0, so y = 2x. In point-slope form, y − 2 = 2(x − 1). In standard form, 2x − y = 0.

Check it: at x = 4, y = 2(4) = 8 ✓.

Now a harder pair: (5, 1) and (5, 7). The run is 5 − 5 = 0. There is nothing to divide by, so the slope is undefined and the line is x = 5.

And a flat one: (1, 3) and (7, 3). The rise is 0, so m = 0 ÷ 6 = 0. The line is y = 3. Note the asymmetry — a zero on top gives a slope of zero, a zero on the bottom gives no slope at all.

Parallel and Perpendicular Lines

Slope is the tool for both relationships.

Parallel lines have equal slopes. They rise at the same rate, so they never converge. Two lines with m = 3 are parallel no matter where they sit.

Both parts of "negative reciprocal" are required. Flipping 2 to ½ without the minus sign gives a line that is not perpendicular at all.

The exception is the vertical case, which the rule cannot express: a vertical line is perpendicular to a horizontal one, but you cannot multiply an undefined slope by zero and get −1. Treat that pair as a special case.

Understanding Your Result

The slope is the plain ratio, shown as an exact fraction where the coordinates are whole numbers, because 2/3 is precise and 0.667 is not.

The angle and grade restate the same steepness for when you need degrees or a percentage.

The equation of the line appears in all three forms schools use. Slope-intercept, y = mx + b, is best for graphing. Point-slope, y − y₁ = m(x − x₁), is what you write first when handed a point and a slope. Standard form, ax + by = c, keeps the coefficients whole and is what systems of equations expect.

The rise and run are shown separately so you can spot a mis-typed coordinate at a glance.

When Should You Use This Calculator?

Algebra and geometry homework. Slope underpins linear equations, and the working shows where a hand attempt diverged.

Building a ramp or a drain. Accessibility standards are written as grades — a 1:12 ramp is a slope of 0.0833, or 8.33%, or 4.76°. Drainage is specified as a minimum fall per metre, which is a slope.

Reading a road or trail profile. Cycling and hiking routes quote gradients as percentages; converting to degrees makes them intuitive.

Roof pitch. Builders quote pitch as rise over a 12-inch run, which is a slope in different clothing.

Any rate of change. Cost per unit, litres per minute, degrees per hour — the slope between two readings is the average rate over that interval.

Common Mistakes

Swapping only one coordinate. Using y₂ − y₁ over x₁ − x₂ flips the sign. Both subtractions must go the same way.

Putting the run on top. Rise over run, not run over rise. Inverting gives the reciprocal, which is a genuinely different line.

Calling a vertical slope infinite. It is undefined. The distinction matters as soon as you try to use the value in an equation.

Assuming 100% grade means vertical. It means 45 degrees. Grade has no upper limit.

Mixing degrees into arithmetic meant for slopes. You cannot average two angles to get the average slope, or add a 10% grade to a 20% grade to get 30% of anything useful. Convert to slopes, work there, convert back.

Forgetting the minus sign in the perpendicular rule. Negative reciprocal, not just reciprocal.

Reading coordinates off a graph with unequal axis scales. A line drawn at 45 degrees on screen has a slope of 1 only when both axes use the same scale.

Frequently Asked Questions

What does slope actually measure?

How much the line rises for each unit it runs sideways. A slope of two means climbing two units for every one across. It is a rate of change, which is why the same quantity appears as speed on a distance-time graph and as gradient on a hillside.

Why is a vertical line's slope undefined rather than infinite?

Because the run is zero and division by zero has no value. Saying the slope is infinite suggests a very large number, but there is no number at all. The honest answer is that a vertical line has no slope, and its equation is written as x equals a constant.

What is the difference between slope, angle and grade?

All three describe the same steepness in different units. Slope is the plain ratio, the angle is its arctangent in degrees, and grade is the slope written as a percentage. A slope of one is forty-five degrees and a hundred percent grade, which surprises people expecting a hundred percent to mean vertical.

Does the order of the two points matter?

No, as long as you are consistent. Swapping both points negates the rise and the run, and the two minus signs cancel. Swapping only one of them, which is the common slip, reverses the sign and gives the wrong answer.

How are the slopes of parallel and perpendicular lines related?

Parallel lines have equal slopes. Perpendicular lines have slopes whose product is negative one, so each is the negative reciprocal of the other. A line of slope two is perpendicular to one of slope negative one half.

Last reviewed September 17, 2026 by the CalculatorPeak editorial team.