Slope Calculator
Enter Two Points
Results
Graph
How to Calculate Slope Between Two Points
The slope of a line measures its steepness and direction, defined as the ratio of vertical change (rise) to horizontal change (run) between any two points on the line. Mathematically, the slope formula is m = (y2 - y1) / (x2 - x1), where (x1, y1) and (x2, y2) are two distinct points. A positive slope indicates the line rises from left to right, a negative slope means it falls, a zero slope is a horizontal line, and an undefined slope represents a vertical line.
Once you know the slope and a point on the line, you can determine the full equation using the slope-intercept form y = mx + b, where b is the y-intercept found by substituting a known point: b = y1 - m * x1. This equation describes every point on the line and is fundamental in algebra, physics, and engineering for modeling linear relationships such as velocity, cost functions, and trend lines.
This calculator also computes the distance between points using the Pythagorean-derived formula d = sqrt((x2 - x1)^2 + (y2 - y1)^2) and the midpoint using ((x1 + x2)/2, (y1 + y2)/2). The angle of inclination tells you the angle the line makes with the positive x-axis, calculated as arctan(m). Whether you are studying coordinate geometry, graphing linear equations, or analyzing data trends, understanding slope is an essential mathematical skill that connects algebra to real-world applications.
Formula
m = (y₂ − y₁) / (x₂ − x₁)
Where:
- (x₁, y₁) and (x₂, y₂) = two points on the line
- m = slope (rise over run)
- Positive m = line rises left to right; negative m = line falls
- m = 0 means horizontal line; undefined (x₁ = x₂) means vertical line
Example Calculation
Scenario: Find the slope between points (2, 3) and (8, 15)
- Step 1: m = (15 − 3) / (8 − 2) = 12 / 6 = 2
- Step 2: y-intercept: b = 3 − 2 × 2 = −1
- Step 3: Equation: y = 2x − 1
- Result: Slope = 2 (line rises 2 units for every 1 unit right)