Slope Calculator - Find Slope from Two Points or Equation
Calculate the slope of a line using two coordinate points or a line equation — get slope, angle in degrees and radians, distance between points, and the full line equation instantly.
Select a calculation method and enter the required values to find the slope, angle, and other line properties.
Slope Calculator - Find Slope from Two Points or Equation
Calculate the slope of a line using two coordinate points or a line equation — get slope, angle in degrees and radians, distance between points, and the full line equation instantly.
About the Slope Calculator
The slope of a line is a number that describes both the direction and the steepness of the line. It is defined as the ratio of the vertical change (rise) to the horizontal change (run) between any two points on the line: m = (y₂ − y₁) / (x₂ − x₁). Because a straight line has the same inclination everywhere, it does not matter which two points you choose — the ratio is always the same.
A positive slope means the line rises from left to right: as x increases, y increases. A negative slope means the line falls from left to right: as x increases, y decreases. A slope of zero means the line is perfectly horizontal — there is no rise at all. An undefined slope means the line is perfectly vertical — the denominator (x₂ − x₁) equals zero, and division by zero is undefined in mathematics. A vertical line has no single slope value because it is infinitely steep.
The magnitude of the slope indicates steepness. A slope of 0.1 is nearly flat, a slope of 1 makes a 45° angle with the x-axis, and a slope of 10 is very steep. The angle of inclination θ of a line (measured from the positive x-axis) is related to the slope by m = tan(θ), or equivalently θ = arctan(m). This calculator computes the angle in both degrees and radians alongside the slope.
Slope can also be extracted from a line written in slope-intercept form y = mx + b, where m is the slope and b is the y-intercept (the value of y when x = 0). This calculator's equation mode parses expressions of this form directly. For example, the equation y = −2.5x + 7 has slope m = −2.5, which means the line falls 2.5 units for every 1 unit moved to the right.
When two points are given, this calculator also computes the Euclidean distance between them using the distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²), which is a direct application of the Pythagorean theorem in the coordinate plane. It also derives the full line equation in slope-intercept form y = mx + b by computing b = y₁ − m·x₁.
Two lines are parallel if and only if they have the same slope. Two lines are perpendicular if and only if their slopes are negative reciprocals: if one line has slope m, the perpendicular line has slope −1/m (assuming neither line is vertical or horizontal). For example, lines with slopes 2 and −0.5 are perpendicular. This relationship is important in geometry proofs, engineering design, and computer graphics.
In real-world applications, slope appears constantly. In civil engineering, road grade (expressed as a percentage) is the slope multiplied by 100 — a 5% grade rises 5 metres for every 100 metres of horizontal distance. In physics, the slope of a displacement-time graph gives velocity, and the slope of a velocity-time graph gives acceleration. In economics, the slope of a supply or demand curve represents the rate at which quantity changes with price. In data analysis, the slope of a linear regression line summarises the trend in the data.
Slope Calculator Examples
Examples covering positive slope, negative slope, zero slope, and equation input.
| Input | Slope | Notes |
|---|---|---|
| Two points: (2, 3) and (5, 9) | m = 2 | Rise = 9 − 3 = 6, run = 5 − 2 = 3. Slope = 6/3 = 2. Line rises 2 units per 1 unit right. |
| Two points: (−1, 5) and (3, 1) | m = −1 | Rise = 1 − 5 = −4, run = 3 − (−1) = 4. Slope = −4/4 = −1. Line falls 1 unit per 1 unit right. |
| Two points: (1, 4) and (6, 4) | m = 0 | Both y-coordinates are 4. Rise = 0. Any horizontal line has slope 0. |
| Equation: y = −2.5x + 7 | m = −2.5 | The coefficient of x in slope-intercept form is the slope directly. Angle ≈ −68.2°. |
How to Use the Slope Calculator
- Choose the calculation method: click From Two Points to enter two coordinate pairs, or From Line Equation to parse a y = mx + b expression.
- For the two-points method, enter x₁, y₁ for the first point and x₂, y₂ for the second point. Negative values and decimals are accepted.
- For the equation method, type the equation in y = mx + b form in the input field, for example y = 3x - 2.
- Click Calculate. The slope, angle of inclination in degrees and radians, distance between points (for two-points mode), and the line equation are all displayed instantly.
- Use the Reset button to clear all fields, or click one of the quick-load example buttons to populate the calculator with a common scenario.
Slope Calculator FAQ
What does a slope of zero mean?
A slope of zero means the line is perfectly horizontal. The y-coordinates of every point on the line are identical, so there is no vertical change (rise = 0) as x increases. Horizontal lines have equations of the form y = c, where c is a constant.
What is an undefined slope?
A vertical line has an undefined slope because the horizontal change (run) between any two points on it is zero. Division by zero is undefined in mathematics. Vertical lines have equations of the form x = c. This calculator displays 'Undefined (vertical line)' when the two input x-coordinates are equal.
How do I find the slope from a graph?
Pick any two points on the line that lie at grid intersections for easy reading. Count the rise (vertical distance, positive upward) and run (horizontal distance, positive rightward) between them, then divide rise by run. If the line goes up from left to right the slope is positive; if it goes down, the slope is negative. You can then enter those two points into this calculator to confirm.
What is the relationship between slope and angle?
The slope m equals the tangent of the angle of inclination θ: m = tan(θ). Equivalently, θ = arctan(m). A slope of 1 gives a 45° angle; a slope of −1 gives −45°. The angle is always in the range (−90°, 90°) for lines with defined slope, since arctan is the principal value. This calculator reports both the slope and the corresponding angle.
How are slopes of perpendicular lines related?
If two non-vertical lines are perpendicular, their slopes are negative reciprocals: m₁ · m₂ = −1. For example, if one line has slope 3, a perpendicular line has slope −1/3. The product of their slopes always equals −1. This rule does not apply when one line is horizontal (slope 0) and the other vertical (undefined slope), but those lines are still perpendicular.
Does the order of the two points affect the slope?
No. Swapping point 1 and point 2 negates both the numerator (y₂ − y₁ becomes y₁ − y₂) and the denominator (x₂ − x₁ becomes x₁ − x₂), so the ratio stays the same: (y₁ − y₂) / (x₁ − x₂) = (y₂ − y₁) / (x₂ − x₁). The slope is a property of the line, not of the labelling of its points.