Slope & Linear Equation Calculator
The slope calculator finds the slope between any two points on a line, along with the midpoint, the distance between the points, and the full line equation in slope-intercept form (y = mx + b) — showing every step of the working. Enter two coordinate points below and get a complete step-by-step solution instantly.
This free slope and linear equation calculator also converts slope into a percentage grade or an angle in degrees — useful for ramps, roads, and roof pitch. No signup required.
Step-by-Step Solution
What Is Slope?
Slope describes how steep a line is — how much the y-value changes for every step the x-value takes. It is often explained as "rise over run": the vertical change (rise) divided by the horizontal change (run) between two points on the line. CK-12 Foundation's lesson on slope and linear equations covers this with additional practice problems if you want more examples.
Types of Slope
| Type | What it looks like |
|---|---|
| Positive slope | The line rises from left to right. As x increases, y increases. |
| Negative slope | The line falls from left to right. As x increases, y decreases. |
| Zero slope | A perfectly horizontal line. Rise = 0, so slope = 0. |
| Undefined slope | A perfectly vertical line. Run = 0, so the slope formula divides by zero. |
Slope, Midpoint, and Distance Formulas Explained
The Slope Formula
Given two points on a line, (x₁, y₁) and (x₂, y₂), the slope m is the change in y divided by the change in x:
Slope-Intercept Form: y = mx + b
Once you know the slope, you can write the full equation of the line in slope-intercept form. Substitute the slope and one known point into y = mx + b, then solve for b (the y-intercept).
The Midpoint Formula
The midpoint is the exact center point between two coordinates — found by averaging the x-values and averaging the y-values separately.
The Distance Formula
The distance formula finds the straight-line length between two points. It is a direct application of the Pythagorean theorem, treating the horizontal and vertical changes as the two legs of a right triangle.
How to Use This Slope Calculator
- Enter the coordinates of two points: (x₁, y₁) and (x₂, y₂).
- Click Calculate. The calculator instantly returns the slope, the full line equation (y = mx + b), the midpoint, and the distance between the points.
- The live graph updates automatically, plotting both points and the line that connects them.
- Use the Percentage / Degree tab to convert any slope into a percent grade or an angle in degrees — useful for ramps, roofs, and roads.
- Click Reset to clear all inputs and start a new calculation.
The calculator accepts positive numbers, negative numbers, and decimals for every coordinate. If the two x-values are identical, the calculator reports the slope as undefined (a vertical line).
Worked Examples — Step by Step
Example 1: Find the Slope Between Two Points
Find the slope of the line through (2, 3) and (6, 11).
- Write the two points: (x₁, y₁) = (2, 3) and (x₂, y₂) = (6, 11)
- Write the slope formula: m = (y₂ − y₁) / (x₂ − x₁)
- Substitute the values: m = (11 − 3) / (6 − 2)
- Subtract: m = 8 / 4
- Simplify: m = 2
Example 2: Write the Line Equation (y = mx + b)
Using the same two points, (2, 3) and (6, 11), write the full equation of the line.
- Start with the slope already found: m = 2
- Write the slope-intercept form: y = mx + b
- Substitute the point (2, 3) and the slope: 3 = 2(2) + b
- Multiply: 3 = 4 + b
- Solve for b: b = 3 − 4 = −1
- Write the full equation: y = 2x − 1
- Verify with the second point (6, 11): y = 2(6) − 1 = 12 − 1 = 11 ✓
Example 3: Find the Midpoint
Find the midpoint between (2, 3) and (6, 11).
- Write the two points: (2, 3) and (6, 11)
- Average the x-values: (2 + 6) / 2 = 8 / 2 = 4
- Average the y-values: (3 + 11) / 2 = 14 / 2 = 7
- Combine into a coordinate pair: (4, 7)
Example 4: Find the Distance Between Two Points
Find the distance between (2, 3) and (6, 11).
- Write the two points: (2, 3) and (6, 11)
- Find the horizontal change: 6 − 2 = 4
- Find the vertical change: 11 − 3 = 8
- Square both changes: 4² = 16 and 8² = 64
- Add the squares: 16 + 64 = 80
- Take the square root: d = √80 = 4√5 ≈ 8.94
Example 5: Convert a Ramp Slope Ratio to a Percentage and an Angle
A wheelchair ramp has a slope ratio of 1:12 — a common maximum ratio referenced in ADA ramp guidance. Convert this ratio to a percentage grade and an angle in degrees.
- Write the ratio as a slope: rise 1, run 12 → slope = 1/12
- Convert to a percentage: (1 ÷ 12) × 100 = 8.33%
- Convert to an angle: angle = arctan(1/12)
- Calculate: arctan(0.0833) ≈ 4.76°
When to Use a Slope Calculator
Slope shows up anywhere a line, ramp, road, or surface changes height over a distance. Common situations include:
- Algebra class: finding the slope between two points, writing the equation of a line, or graphing linear equations from a table of values.
- Construction and ramps: checking that a wheelchair ramp meets the maximum allowed slope ratio (commonly 1:12).
- Roofing: roof pitch is a slope expressed as a ratio (rise over a 12-inch run), which this calculator can convert to degrees.
- Roads and driving: road grade signs show slope as a percentage — a 6% grade means the road rises 6 feet for every 100 feet traveled.
- Geometry and coordinate proofs: the midpoint and distance formulas are used together to prove properties of shapes on a coordinate plane.
Percent Grade, Slope Ratios, and Ramp Requirements
Slope is often written as a ratio (like 1:12), a percentage (like 8.33%), or an angle in degrees (like 4.76°). All three describe the same steepness — just in different formats used by different industries.
A slope ratio of 1:12 is widely referenced as a maximum for wheelchair ramp construction — meaning the ramp cannot rise more than 1 inch for every 12 inches of horizontal run. Steeper ratios like 1:10 or 1:8 are sometimes used for short rises, while gentler ratios like 1:20 or 1:100 apply to long, gradual ramps and walkways. Always confirm exact requirements with local building codes, since specific rules vary by jurisdiction.
Common Mistakes When Finding Slope
- Subtracting coordinates in the wrong order: the y-values and x-values must be subtracted in the same order (both point 2 minus point 1, or both point 1 minus point 2) — mixing the order flips the sign of the slope.
- Mixing up rise and run: slope is rise over run (change in y over change in x), not the reverse — flipping the fraction gives the reciprocal of the correct slope.
- Treating a vertical line as having zero slope: a vertical line has an undefined slope, not a slope of zero — zero slope describes a horizontal line instead.
- Losing track of negative signs: when either point has negative coordinates, a dropped negative sign is one of the most common sources of an incorrect slope.
Frequently Asked Questions
- What is slope?
- Slope is a number that describes how steep a line is. It measures how much the y-value changes for every unit the x-value changes — often described as "rise over run." A positive slope rises left to right, a negative slope falls left to right, and a slope of zero is a flat, horizontal line.
- How do you find the slope of a line from two points?
- Use the slope formula: m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-values to get the rise, subtract the x-values to get the run, then divide the rise by the run. For example, for the points (2, 3) and (6, 11): m = (11 − 3) / (6 − 2) = 8 / 4 = 2.
- How do you write the equation of a line in slope-intercept form?
- First find the slope using two points. Then substitute the slope and one known point into y = mx + b and solve for b, the y-intercept. For example, with slope 2 and point (2, 3): 3 = 2(2) + b, so b = −1, giving the equation y = 2x − 1.
- How do you find the midpoint between two points?
- Average the two x-values and average the two y-values separately. The midpoint formula is: Midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2). For (2, 3) and (6, 11), the midpoint is (4, 7).
- How do you find the distance between two points?
- Use the distance formula: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. This is the Pythagorean theorem applied to a coordinate plane, treating the change in x and change in y as the two legs of a right triangle. For (2, 3) and (6, 11), the distance is √80, or about 8.94 units.
- How do you convert slope to a percentage or a degree?
- To convert slope to a percentage, divide the rise by the run and multiply by 100. To convert to degrees, take the inverse tangent (arctan) of the rise divided by the run. For example, a slope of 1/12 equals an 8.33% grade and an angle of about 4.76°.
- What does a 1:12 slope ratio mean for a ramp?
- A 1:12 slope ratio means the ramp rises 1 unit of height for every 12 units of horizontal run. This ratio is widely referenced as a common maximum for wheelchair ramp construction. Always check local building codes for the exact requirement in your area, since rules can vary.
- What is the difference between slope and gradient?
- Slope and gradient describe the same thing — the steepness of a line or surface — just using different vocabulary. "Slope" is more common in US algebra classes, while "gradient" is more common in engineering, surveying, and outside the US. Both use the same rise-over-run calculation.
Related Calculators
Pythagorean Theorem CalculatorFind the missing side of a right triangle — the same formula that powers the distance formula used here. Quadratic Formula Calculator
Solve any quadratic equation ax²+bx+c=0 with step-by-step working and a parabola graph. Percentage Calculator
Convert a slope or ratio into a percentage, or calculate percent increase, decrease, and percent error.
Midpoint & Distance Calculator
Enter the same two points to find midpoint and distance.
Slope-Intercept Form
Enter slope (m) and y-intercept (b) to get the line equation and graph.