Slope Calculator with Line Equation and Steps
Enter two coordinate points to find the exact rise, run and slope. Review the line equation, intercepts, midpoint, distance, inclination angle and exact verification without converting your coordinates to floating-point values first.
Last Updated: July 26, 2026
Online Slope Calculator
Enter Point 1 and Point 2 as exact coordinates. Integers, decimals, fractions, mixed numbers and scientific notation are supported.
Your slope and line details will appear here.
Line equations and intercepts
Exact line verification
| Point | Substitution in Ax + By | Left side | Right side | Check |
|---|---|---|---|---|
| Calculate a slope to verify both points. | ||||
Calculation steps
- Enter two coordinate points and select Calculate Slope.
Recent calculations
- Your last six results will appear here.
How to Use This Slope Calculator
- Enter the x and y coordinates for Point 1.
- Enter the x and y coordinates for Point 2. The two entries may be integers, decimals, fractions, mixed numbers or scientific notation.
- Select Calculate Slope. The tool subtracts the coordinates in one consistent direction, Point 2 minus Point 1.
- Read the exact slope first. Then review the rise, run, line type, equations, intercepts, midpoint, distance and angle.
- Use the verification table to confirm that both original points satisfy the displayed standard-form equation.
Keep the axes and units clear. If x measures hours and y measures kilometres, the slope is kilometres per hour. Distance and inclination have their usual Cartesian meaning only when both axes use compatible units and equal visual scales.
What This Calculator Finds
The primary result is the exact slope between two entered points. Supporting outputs explain the same straight-line relationship from different views. Rise and run show the coordinate changes. Point-slope, slope-intercept and standard forms describe the line algebraically. Intercepts show where the unique line meets each axis. Midpoint identifies the segment centre, while distance gives the segment length and inclination describes the line direction.
These outputs do not change the original task. Midpoint and distance apply to the finite segment between the two points, while slope and the line equations apply to the entire straight line extending through them. Exact substitution of both entered points provides the final consistency check.
Slope Formula from Two Points
Slope measures the vertical change in a straight line for each unit of horizontal change. For Point 1, (x1, y1), and Point 2, (x2, y2), calculate rise and run in the same order.
Run: Δx = x₂ − x₁
Slope: m = Δy ÷ Δx = (y₂ − y₁) ÷ (x₂ − x₁)
Switching the two points does not change the slope. Both differences reverse sign, so the quotient stays the same. Mixing the order, such as y2 − y1 over x1 − x2, changes the sign and gives the wrong direction.
Method reference: OpenStax Intermediate Algebra 2e, Slope of a Line.
Understanding Positive, Negative, Zero and Undefined Slope
| Result | Coordinate condition | Meaning |
|---|---|---|
| Positive slope | Δy and Δx have the same sign | The line rises from left to right. |
| Negative slope | Δy and Δx have opposite signs | The line falls from left to right. |
| Zero slope | Δy = 0 and Δx ≠ 0 | The line is horizontal. |
| Undefined slope | Δx = 0 and Δy ≠ 0 | The line is vertical. Division by zero is undefined. |
| Indeterminate | Δx = 0 and Δy = 0 | The points coincide, so one unique line is not determined. |
Worked Example: Positive Slope
Use Point 1 = (2, 3) and Point 2 = (8, 15). The y-value increases by 12 while the x-value increases by 6.
Run = 8 − 2 = 6
m = 12 ÷ 6 = 2
Point-slope form: y − 3 = 2(x − 2)
Slope-intercept form: y = 2x − 1
Standard form: 2x − y = 1
The midpoint is (5, 9). The exact distance is 6√5, approximately 13.416408. The line inclination is approximately 63.434949 degrees. Substituting either point into 2x − y gives 1, so both points pass the exact equation check.
Worked Example: Negative Fractional Slope
Use Point 1 = (−3, 5) and Point 2 = (1, −1). The line moves down 6 units while moving right 4 units.
Run = 1 − (−3) = 4
m = −6 ÷ 4 = −3/2
Slope-intercept form: y = (−3/2)x + 1/2
Standard form: 3x + 2y = 1
A negative slope means y decreases as x increases. The midpoint is (−1, 2), the distance is 2√13, approximately 7.211103, and the inclination is approximately 123.690068 degrees. The angle stays between 0 and 180 degrees, so a negative slope receives an obtuse inclination rather than a negative angle.
Vertical, Horizontal and Coincident Points
Vertical line
Points (4, −2) and (4, 7) have run 0 and rise 9. The slope is undefined, not infinity. The unique line equation is x = 4, its inclination is 90 degrees, and its x-intercept is (4, 0). It has no y-intercept because it never reaches x = 0.
Horizontal line
Points (−2, 6) and (5, 6) have rise 0 and run 7. The slope is 0, and the line equation is y = 6. The line has y-intercept (0, 6) and no x-intercept. If the horizontal line is y = 0, it is the x-axis and every point on it is an x-intercept.
Coincident points
If both entered points are identical, rise and run are both 0. The expression 0/0 is indeterminate. Infinitely many lines pass through one point, so there is no unique slope, equation, angle or pair of intercepts. The midpoint is still the entered point and the distance is 0.
Equation of the Line Through Two Points
For a nonvertical line, point-slope form starts with one point and the calculated slope: y − y1 = m(x − x1). Expanding this form gives slope-intercept form, y = mx + b, where b = y1 − mx1.
The calculator also gives primitive integer standard form, Ax + By = C. It clears exact denominators, divides A, B and C by their greatest common factor, and uses a consistent leading sign. Standard form works for vertical, horizontal and slanted unique lines. It also supports an exact substitution check without relying on rounded slope decimals.
How Intercepts Are Calculated
An x-intercept occurs where y = 0. In Ax + By = C, solve Ax = C to get x = C/A when A is nonzero. A y-intercept occurs where x = 0, giving y = C/B when B is nonzero.
Special lines need careful language. A horizontal line above or below the x-axis has no x-intercept. The x-axis has infinitely many x-intercepts. A vertical line away from the y-axis has no y-intercept, while the y-axis has infinitely many y-intercepts. Coincident input points do not determine intercepts because they do not determine one line.
Midpoint, Distance and Inclination Angle
Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
Inclination = arctan(m), normalized to 0° ≤ angle < 180°
The midpoint and exact squared distance use rational arithmetic. The displayed radical is simplified when the tool proves a square factor. For unusually large radicals, it may keep a correct unsimplified square-root form instead of making an unsupported simplification claim. Decimal distance and non-special angles are marked as approximations.
Exact Fractions, Units and Rounding
The calculator parses each coordinate directly into a reduced rational number. It does not first convert a value such as 1/3, 9007199254740993 or 1e−20 into an ordinary JavaScript floating-point number. Rise, run, slope, midpoint, line coefficients, intercepts and verification therefore stay exact within the stated input limits.
Decimal slope is a secondary display. A terminating decimal is shown without an approximation mark. A repeating or longer decimal receives the ≈ sign. Distance and angle generally involve square roots or inverse tangent, so their decimal forms are approximations even when the coordinate arithmetic is exact.
Slope carries y-units per x-unit. It is unitless only when both axes use the same unit. An inclination angle also assumes equal axis scaling. A stretched graph can look steeper or flatter even though the mathematical slope has not changed.
Common Slope Mistakes
- Dividing run by rise. The formula is vertical change divided by horizontal change.
- Subtracting y-values in one order and x-values in the opposite order.
- Calling a vertical slope zero. Horizontal slope is 0, while vertical slope is undefined.
- Treating two identical points as a vertical line. One point does not define a unique line.
- Rounding a fraction before simplifying it or using it in the line equation.
- Ignoring units, incompatible axis scales or the required rounding rule.
Method, Limits and Result Review
Each coordinate may contain up to 50 digits, with scientific exponents from −100 through 100. Fraction denominators must be nonzero. The calculator classifies the exact rise and run before any decimal conversion, normalizes the standard-form equation, and substitutes both original points back into that equation.
This page accepts two points only. It does not plot a graph, solve a typed equation, find the intersection of several lines, fit a regression line to a dataset, calculate a derivative, or convert slope into roof pitch or road grade. Use the specialist calculator for those different tasks.
Related Calculators
Frequently Asked Questions
How do you calculate slope from two points?
Subtract the y-values and divide by the matching difference between the x-values: m = (y₂ − y₁)/(x₂ − x₁).
Does switching the two points change the slope?
No. Switching the points reverses both rise and run, so their ratio stays the same.
What does rise over run mean?
Rise is the vertical change, Δy. Run is the horizontal change, Δx. Slope is rise divided by run.
What is the slope of a horizontal line?
A horizontal line has zero rise and nonzero run, so its slope is 0.
What is the slope of a vertical line?
A vertical line has zero run. Division by zero is undefined, so its slope is undefined rather than infinite.
What happens when both points are identical?
The calculation becomes 0/0. One point alone does not define a unique line, slope, equation, angle or set of intercepts.
What does a negative slope mean?
It means y decreases as x increases, so the line falls from left to right.
Should slope be written as a fraction or decimal?
Keep the reduced fraction when an exact answer matters. Use a decimal when the task requests one, and retain enough precision.
How do you find the equation from two points?
Find the slope, then place one point into y − y₁ = m(x − x₁). Simplify to slope-intercept or standard form if needed.
How are the intercepts calculated?
Set x = 0 for the y-intercept and y = 0 for the x-intercept. Vertical and horizontal axis lines require special handling.
How do you convert slope to an angle?
For a nonvertical line, use the inverse tangent of the slope and normalize the inclination to 0 degrees through less than 180 degrees.
Can this calculator use three or more points?
No. This tool uses two points to define one straight line. Multiple points require a collinearity check or linear regression.