Skip to the calculator
Rule Calculator

Slope Calculator

With x₁ 2, y₁ 3, x₂ 6, y₂ 11, slope comes to 2.000000 — slope. It is reached in 8 steps, the last of which is 8 / 4, and each one is printed on the page with its numbers filled in. The formula is the one published by Wolfram MathWorld, not an approximation fitted to it.

Slope, intercept, angle and the full line equation from two points, with the perpendicular slope beside it.

Formula and sources checked · How we check

x₁ 2, y₁ 3, x₂ 6, y₂ 11

2.000000

Slope for the example below. Editing a field recomputes the calculator below; this figure holds the answer the page was loaded with.

It is written into the HTML rather than drawn by a script, so a search engine reading this page without running JavaScript still finds an answer.

Slope
2.000000
Rise, y₂ − y₁
11 - 38
Run, x₂ − x₁
6 - 24
Slope, m
8 / 42
y-intercept, b
3 - 2 * 2-1
Angle from horizontal
atan(2) * 180 / pi63.435 °
As a percentage grade
2 * 100200 %
Perpendicular slope
-1 / 2-0.5
Distance between the points
sqrt(pow(8, 2) + pow(4, 2))8.944

Ask about this in the chat

Worked example

From (2, 3) to (6, 11) the rise is 8 and the run is 4, so the slope is 2 and the line is y = 2x − 1. That is an angle of 63.4 degrees from horizontal, and any line perpendicular to it has a slope of −0.5.

How to work it out yourself

  1. 1.Subtract the y values for the rise and the x values for the run, in the same order. Reversing both gives the same slope; reversing one gives the wrong sign.
  2. 2.Read the intercept to get the line in y = mx + b form, which is what most questions are really asking for.
  3. 3.For a road or a roof, read the grade line: a slope of 0.06 is a 6% grade, and that is how gradients are signposted.

The formula

  1. Rise, y₂ − y₁11 - 3
  2. Run, x₂ − x₁6 - 2
  3. Slope, m8 / 4
  4. y-intercept, b3 - 2 * 2
  5. Angle from horizontalatan(2) * 180 / pi
  6. As a percentage grade2 * 100
  7. Perpendicular slope-1 / 2
  8. Distance between the pointssqrt(pow(8, 2) + pow(4, 2))

Source: Wolfram MathWorld — line

Questions people actually ask

What is the slope of a vertical line?
Undefined, not infinite and not zero. The run is zero and division by zero has no value, so the line has no slope — while a horizontal line has a slope of exactly zero. This calculator reports the angle as 90 degrees and flags the case rather than printing a number that would be false.
How do I get the equation of the line?
Take the slope, then substitute either point into y = mx + b and solve for b. With a slope of 2 through (2, 3): 3 = 2 × 2 + b, so b = −1 and the line is y = 2x − 1. Either point gives the same answer, which is a useful check on the arithmetic.
What is a perpendicular slope?
The negative reciprocal: flip it and change the sign. A slope of 2 is perpendicular to −1/2, and their product is always −1. A horizontal line is perpendicular to a vertical one, which is the case where the rule breaks down because one of the two has no slope to reciprocate.
Is slope the same as angle?
No — slope is the tangent of the angle, which is why it grows without limit while the angle stops at 90 degrees. A 45-degree line has a slope of exactly 1, a 60-degree line has 1.73, and an 80-degree line has 5.67. That is also why a 100% grade on a road sign means 45 degrees rather than vertical.

Related

Put this calculator on your site

Free, no attribution required beyond the link.

<iframe src="https://rulecalculators.com/embed/slope" width="100%" height="420" style="border:1px solid #e7e4de;border-radius:12px" title="Slope Calculator"></iframe>
Did this answer your question?