Slope Calculator

Get the slope, angle, line equation, intercepts, distance and midpoint from two points.

Number entry: use a point for decimals (1.5). Commas grouped in threes are thousands separators (1,250), and a single comma such as 1,5 is read as a decimal comma. Nothing you enter leaves your device.

Showing the example values. Change the inputs and press Calculate for your own result.

Slope (m)

2

y = 2x + 0

Rise (Δy)
8
Run (Δx)
4
Angle of inclination
63.434949°

Steepness measured from the horizontal, ignoring direction

Grade (percent)
200%
Distance between points
8.94427191
Midpoint
(3, 6)
y-intercept
0
x-intercept
0
Direction
Rising (positive slope)

Working

  1. m = (y₂ − y₁) ÷ (x₂ − x₁) = (10 − 2) ÷ (5 − 1) = 2.
  2. b = y₁ − m × x₁ = 0.
  3. Line: y = 2x + 0.

About the slope calculator

The slope calculator takes two points and returns the slope of the line through them, its angle, the equation of the line, both intercepts, the distance between the points and their midpoint.

It treats vertical lines properly: the slope is reported as undefined and the equation is given as x = a constant.

Who should use the slope calculator

  • Algebra and geometry students.
  • Builders and surveyors checking gradients.
  • Analysts fitting a straight line through two data points.

How to use the slope calculator: what each input means

Points (x₁, y₁) and (x₂, y₂)
Any real coordinates. The points must be different.

How the slope calculator works: method and formula

Slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). The y-intercept is b = y₁ − m × x₁, giving the line y = mx + b. The angle is the arctangent of the slope, and grade as a percentage is the slope times 100.

Slope
m = (y₂ − y₁) ÷ (x₂ − x₁)
Line
y = m x + b
Angle
θ = arctan(m)

How to read your slope calculator result

A positive slope rises left to right, a negative slope falls and a zero slope is flat. A 100% grade is a 45° angle. Parallel lines share the same slope, and perpendicular lines have slopes whose product is −1.

Slope Calculator worked example

Points (1, 2) and (5, 10).

  1. Rise = 10 − 2 = 8; run = 5 − 1 = 4.
  2. Slope = 8 ÷ 4 = 2.
  3. Intercept b = 2 − 2 × 1 = 0, so the line is y = 2x + 0.
  4. Angle = 63.435°; distance = 8.9443; midpoint = (3, 6).

Slope 2, line y = 2x.

Practical uses of the slope calculator

  • Finding the equation of a line from two points.
  • Converting between slope, angle and percent grade.
  • Checking whether two lines are parallel or perpendicular.

Assumptions and limitations of this calculator

  • Straight lines through two points only.
  • Coordinates are treated as being in the same units on both axes.
FAQs

Slope Calculator FAQs

A measure of steepness: the vertical change divided by the horizontal change.

Need Something Built Around Your Numbers?

Code & Motions designs and builds custom calculators, dashboards and web tools for businesses. Tell us what you have in mind.