Slope measures how steep a line is and in which direction it goes. It is the rate of change in any linear relationship: speed, cost per item, growth per year.
How to use the Slope Calculator
- Point 1: x
- Point 1: y
- Point 2: x
- Point 2: y
Results update as you type, and everything is calculated in your browser.
How it works
The changes in y and x give the slope; the intercept follows from one of the points. A zero run means a vertical line with undefined slope.
Inputs explained
| Field | What to enter |
|---|---|
| Point 1: x | A number |
| Point 1: y | A number |
| Point 2: x | A number |
| Point 2: y | A number |
What each result means
- Slope m = ([Point 2: y] – [Point 1: y])÷([Point 2: x] – [Point 1: x])
- y-intercept c = [Point 1: y] – ([Point 2: y] – [Point 1: y])÷([Point 2: x] – [Point 1: x])×[Point 1: x]
- Angle θ = deg(atan(([Point 2: y] – [Point 1: y])÷([Point 2: x] – [Point 1: x])))
- Percentage grade = ([Point 2: y] – [Point 1: y])÷([Point 2: x] – [Point 1: x])×100
- Distance d = sqrt(([Point 2: x] – [Point 1: x])^2 + ([Point 2: y] – [Point 1: y])^2)
- Δx = [Point 2: x] – [Point 1: x]
- Δy = [Point 2: y] – [Point 1: y]
Example values
How the main result changes when Point 1: x changes and everything else stays at the example values above:
| Point 1: x | Slope m |
|---|---|
| 1 | 1.6 |
| 1.5 | 1.7778 |
| 2 | 2 |
| 2.5 | 2.2857 |
| 3 | 2.6667 |
| 4 | 4 |
Formula
m = (y₂ − y₁) ÷ (x₂ − x₁), y = m·x + c
Worked example
Inputs: Point 1 – x: 2; Point 1 – y: 1; Point 2 – x: 6; Point 2 – y: 9.
Results: Slope m = 2; y-intercept c = -3; Angle θ = 63.4349 °; Percentage grade = 200 %; Distance d = 8.94427191; Δx = 4; Δy = 8.
Key terms
- Slope
- The ratio of vertical change to horizontal change.
Frequently asked questions
What is the slope between (2, 1) and (6, 9)?
(9 − 1)/(6 − 2) = 2.
What does a slope of 0 mean?
A horizontal line.
What is an undefined slope?
A vertical line, where the run is zero.
Does the order of the points matter?
No, as long as you subtract in the same order top and bottom.