Education
Slope Calculator
Last updated: June 19, 2026
A slope calculator is a coordinate geometry utility that computes the slope or gradient of a straight line passing through two specified points. It operates by dividing the vertical change, known as the rise, by the horizontal change, known as the run. The calculator identifies positive, negative, zero, and vertical undefined slopes. Educators, students, and civil engineers employ this tool to understand linear equations, design accessibility ramps, and analyze structural grades.
Enter two points and we compute the slope of the line through them. The result shows the rise, the run, the slope value, and the line type, with a step-by-step breakdown that uses your numbers.
Quick Answer
Find the slope of a line passing through two coordinate points. Enter the values for each point to calculate the gradient, rise, and run.
Solve for
Known Values
Enter Point 1 and Point 2 coordinates to compute slope.
Step by step
- 1. Identify coordinates. x₁ = 1, y₁ = 2, x₂ = 3, y₂ = 6.
- 2. Compute the rise (Δy). y₂ − y₁ = 6 − (2) = 4.
- 3. Compute the run (Δx). x₂ − x₁ = 3 − (1) = 2.
- 4. Divide rise by run. m = 4 / 2 = 2.
- 5. Convert formats. Angle is arctan(2) = 63.4349°. Grade is 2 × 100 = 200%. Ratio is 2 : 1.
m =
2
Line rises from left to right
Slope describes the steepness and direction of a line. This calculator determines the decimal slope, angle of inclination, slope percentage (grade), rise-to-run ratio, and linear equations in both slope-intercept (y = mx + b) and point-slope forms.
Examples
(1, 2) and (3, 6)
m = 2 (positive)
(1, 5) and (3, 1)
m = −2 (negative)
(1, 5) and (4, 5)
m = 0 (horizontal)
(3, 1) and (3, 5)
m = undefined (vertical)
How it works
For any two points (x₁, y₁) and (x₂, y₂) on a coordinate plane, the slope of the line through them is:
Slope · m = (y₂ − y₁) / (x₂ − x₁)
The numerator y₂ − y₁ is the rise (the vertical change). The denominator x₂ − x₁ is the run (the horizontal change). When the run is zero, the slope is undefined and the line is vertical. For the related calculations on the same two points, see the distance formula calculator for the line's length and the midpoint formula calculator for its center.
How to calculate the slope of a line
Slope measures the steepness and direction of a straight line on a coordinate plane. It is calculated as the ratio of vertical change (rise) to horizontal change (run) between any two points on the line.
To find the slope (often represented by the variable m) between two coordinate points (x₁, y₁) and (x₂, y₂):
- Identify the coordinates: Let the first point be (x₁, y₁) and the second point be (x₂, y₂).
- Calculate the Rise: Subtract the first y-coordinate from the second y-coordinate:
Rise = y₂ − y₁. - Calculate the Run: Subtract the first x-coordinate from the second x-coordinate in the exact same order:
Run = x₂ − x₁. - Divide Rise by Run: Divide the rise by the run to get the slope:
m = Rise ÷ Run.
Worked example: Slope between (2, -3) and (5, 3)
Let's find the slope of the line passing through the points A(2, -3) and B(5, 3).
Step 1: Assign coordinates
- Point 1: x₁ = 2, y₁ = -3
- Point 2: x₂ = 5, y₂ = 3
Step 2: Subtract y-coordinates (Rise)
Rise = y₂ − y₁ = 3 − (−3) = 3 + 3 = 6
Step 3: Subtract x-coordinates (Run)
Run = x₂ − x₁ = 5 − 2 = 3
Step 4: Divide Rise by Run
m = Rise ÷ Run = 6 ÷ 3 = 2
Result
The slope is 2. This is a positive slope, meaning the line rises from left to right.
Understanding the four types of slope
- Positive Slope (m > 0): The line rises from left to right. As x increases, y increases.
- Negative Slope (m < 0): The line falls from left to right. As x increases, y decreases.
- Zero Slope (m = 0): The line is completely flat and horizontal. The y-values do not change (y₂ = y₁, so the rise is 0).
- Undefined Slope (Vertical): The line is completely vertical. The x-values do not change (x₂ = x₁, so the run is 0). Since you cannot divide by zero, the slope is mathematically undefined.
Slope equation forms
Slope is a fundamental component in describing linear equations. To see how these equations are derived from the basic coordinates, read the detailed guide on the slope formula. The two most common linear equation forms are:
- Slope-Intercept Form:
y = mx + b, where m is the slope and b is the y-intercept (the point where the line crosses the y-axis). - Point-Slope Form:
y − y₁ = m(x − x₁), which allows you to write the equation of a line using its slope m and any single point (x₁, y₁) on that line.
Converting slope to degrees and percentage
Slope can be represented in multiple mathematical formats depending on the context:
- Slope Angle (Degrees): To find the inclination angle (θ) of a line in degrees, take the inverse tangent (arctangent) of the slope (m) and convert radians to degrees:
Angle = arctan(m) × (180 ÷ π). For example, a slope of 1 yields an angle of 45°, while a vertical line has a 90° angle. - Slope Percentage (Grade): Often used in construction and geography to define inclination. To find the percentage, multiply the slope by 100:
Grade (%) = (Rise ÷ Run) × 100. For example, a slope of 0.1 represents a 10% grade. - Ratio (Rise:Run): Expresses how many vertical units of rise occur for every horizontal unit of run. For example, a slope of 0.25 represents a 1:4 ratio (1 unit of rise for every 4 units of run).
Slope conversion reference table
This reference table shows conversions between rise-to-run ratios, decimal slope, angle of inclination (degrees), and percent grade.
| Ratio (Rise:Run) | Decimal Slope | Angle (Degrees) | Percent Grade |
|---|---|---|---|
| 1:20 | 0.05 | 2.9° | 5% |
| 1:12 (maximum slope for ADA-compliant ramps) | 0.0833 | 4.8° | 8.33% |
| 1:10 | 0.1 | 5.7° | 10% |
| 1:8 | 0.125 | 7.1° | 12.5% |
| 1:6 | 0.1667 | 9.5° | 16.67% |
| 1:4 | 0.25 | 14.0° | 25% |
| 1:2 | 0.5 | 26.6° | 50% |
| 1:1 | 1.0 | 45.0° | 100% |
| 2:1 | 2.0 | 63.4° | 200% |
Real-world applications of slope
Slope is a fundamental measurement used across engineering, architecture, and construction:
- Road Grade: Expressed as a percentage. A 6% road grade means the road rises 6 feet vertically for every 100 horizontal feet traveled.
- Wheelchair Ramps (ADA Standards): The Americans with Disabilities Act (ADA) mandates a maximum slope of 1:12 for public ramps. This means for every 1 inch of vertical rise, the ramp must have at least 12 inches of horizontal run (approximately an 8.33% slope or 4.76° angle).
- Roof Pitch: Roofers describe pitch as a ratio of vertical rise over a 12-inch horizontal run (e.g., a "4:12 pitch" rises 4 inches for every 12 inches of run, representing a slope of 1/3).
- Land Drainage: Soil and pipes must have a minimum slope (typically 1% to 2%, or 1/8 to 1/4 inch of drop per linear foot) to ensure proper gravity-assisted water flow and prevent pooling.
Common mistakes when calculating slope
- Subtracting coordinates in inconsistent orders: Doing (y₂ − y₁) / (x₁ − x₂) will flip the sign of the slope. Always subtract both coordinates starting with the same point: (y₂ − y₁) / (x₂ − x₁) or (y₁ − y₂) / (x₁ − x₂).
- Inverting the formula (Run over Rise): Writing the slope as Δx / Δy instead of Δy / Δx. Always remember that slope is "rise over run" (y values on top, x values on bottom).
- Sign errors with negative coordinates: Forgetting that subtracting a negative number yields addition (e.g., 3 − (−5) = 3 + 5 = 8).
- Assuming vertical lines have zero slope: Horizontal lines have a slope of zero, whereas vertical lines have an undefined slope.
Related coordinate geometry tools
Once you find the slope of a line, explore other characteristics of your line segment or equations:
- Slope Intercept Form Calculator — find the equation of a line in y = mx + b format.
- Point Slope Form Calculator — write linear equations from a point and a slope.
- Slope Formula — read the deep-dive guide on rise-over-run calculations.
- Point-Slope Formula — read the guide on writing linear equations using slope.
- Distance Formula Calculator — calculate the straight-line distance between two points.
- Midpoint Formula Calculator — find the exact middle coordinate of a line segment.
- y = mx + b Calculator — plot and graph linear equation intercepts.
- System of Equations Calculator — solve systems of multiple intersecting lines.
Sources: ADA Standards for Accessible Design (ramp running slope 1:12). Last reviewed: June 2026.
Related Calculators
More tools from Education
Frequently asked questions
The slope formula is m = (y₂ − y₁) / (x₂ − x₁). Subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide the rise by the run.
Pick any two points on the line. Subtract the first y-coordinate from the second y-coordinate to calculate the rise. Subtract the first x-coordinate from the second x-coordinate to calculate the run. Divide the rise by the run (rise ÷ run).
Slope describes how steep a line is and its direction. A positive slope rises from left to right; a negative slope falls. A slope of zero indicates a completely horizontal line, while a vertical line has an undefined slope.
When two points have the same x-coordinate, the run (x₂ − x₁) is 0. Dividing by zero is mathematically undefined, so vertical lines are said to have an undefined slope.
A slope of zero means the line is completely horizontal. The two points have the same y-coordinate, so there is no vertical change (rise = 0).
Yes. A negative slope means the line tilts downwards from left to right. As you move from left to right, the y-value decreases.
Yes. The coordinate input fields accept positive and negative decimals, integers, and fractions. The calculator reports the slope, the rise, and the run step by step.
A perpendicular line has a slope that is the negative reciprocal of the original slope. For example, if a line has a slope of 3, the perpendicular line has a slope of −1/3. If the slope is −2/5, the perpendicular slope is 5/2.
ADA-compliant wheelchair ramps must have a maximum slope of 1:12, which is approximately a 4.8° angle of inclination or an 8.33% grade. This means that for every 1 inch of vertical rise, the ramp must have at least 12 inches of horizontal run to ensure accessibility.
To convert a slope to degrees, take the inverse tangent (arctan) of the decimal slope value and convert the resulting radians to degrees by multiplying by 180 and dividing by pi. For example, a slope of 1.0 has an angle of arctan(1.0) = 45°.
A 2% slope is equal to exactly 0.24 inches per foot, which is commonly rounded to 1/4 inch per foot in construction and drainage applications. This represents a drop of 1/4 inch vertically for every 12 inches horizontally.
A 10% grade rises or falls 10 feet vertically for every 100 feet of horizontal distance, which corresponds to a decimal slope of 0.1 and an angle of about 5.7°. This is considered a steep slope for roads, which are typically capped around 6% to 8%.
Related calculators
Education
y = mx + b Calculator
Find the slope-intercept form of a line from two points, point-slope, or slope and y-intercept.
Education
Slope Intercept Form Calculator
Build the slope-intercept equation y = mx + b from two points, a slope and one point, or a standard-form equation Ax + By = C. Returns the slope, y-intercept, and step notes.
Education
Point Slope Form Calculator
Build the point-slope equation y − y₁ = m(x − x₁) from a slope and a point, or from two points. Also converts to slope-intercept form as a secondary output.