Slope Calculator

Slope, line equation and more from two points

Slope m
–

How to find the slope of a line

  1. Enter the coordinates of two points on the line, (x₁, y₁) and (x₂, y₂). Negative numbers and decimals are fine.
  2. Read the slope as a fraction and a decimal, and the equation of the line in slope-intercept form y = mx + b.
  3. The table adds the angle, grade, intercepts, distance, midpoint and the slope of a perpendicular line, and the graph shows the line through both points.

The slope formula

Slope measures steepness: how much y changes for each unit of x. It is "rise over run", m = (y₂ − y₁) ÷ (x₂ − x₁). For the points (1, 2) and (4, 8), the rise is 6 and the run is 3, so the slope is 2: the line climbs two units for every unit to the right. A positive slope rises from left to right, a negative slope falls, zero is horizontal, and a vertical line has an undefined slope because the run is zero.

Once you know the slope, the y-intercept follows from b = y₁ − m·x₁, giving the full equation y = mx + b. Perpendicular lines have slopes that are negative reciprocals (2 and −1/2). The angle of inclination is the arctangent of the slope, and the grade used for roads and ramps is the slope as a percentage: a 1:12 wheelchair ramp is a grade of about 8.3%. Calculations are done in your browser.

What does a slope of 0 mean?

The line is horizontal: y does not change as x changes.

Why is the slope of a vertical line undefined?

The run (x₂ − x₁) is zero, and you cannot divide by zero.

How do I convert slope to an angle?

Angle = arctan(slope). A slope of 1 is 45°.

Made by BufferMint. We also design and build software products for founders. See our services →

Your files and inputs never leave your device; we only count anonymous visits.