About this tool
Find the slope between two points as a fraction and decimal, plus angle, % grade, distance, midpoint and the line equation in three forms, with a graph.
This Slope Calculator takes two points (x₁, y₁) and (x₂, y₂) and works out the slope m = (y₂ − y₁) / (x₂ − x₁). Inputs can be integers, decimals or fractions, and the arithmetic is done with exact fractions, so a slope of 6/5 stays 6/5 instead of becoming a rounded decimal. From the slope it derives the angle of inclination, percent grade, rise over run, the distance between the points in simplest radical form, the midpoint, and the equation of the line in slope-intercept, point-slope, standard and general form. You can also get parallel and perpendicular lines through any point, or find a second point from a slope and distance. Everything runs in your browser.
Open Slope Calculator on AltFTool — it loads instantly in your browser.
Under Two points, type x₁, y₁, x₂ and y₂ — for example (1, 2) and (4, 8) — or tap one of the Examples such as Fractions or Vertical.
Read the Slope m as a fraction and decimal, plus Angle of inclination θ, Percent grade, Distance between points and Midpoint M in Results.
Copy the Slope-intercept form, Point-slope form or Standard form from Equation of the line, and enter a Point x and Point y to get parallel and perpendicular lines.
Switch to Slope + distance → second point, enter x₁, y₁, a Slope m or Angle θ and a Distance d such as 5 to find both end points.
Fraction and decimal inputs are converted to exact ratios, so slopes, intercepts and midpoints show as simplified fractions with the decimal alongside.
Slope-intercept y = mx + b, point-slope, standard Ax + By = C with integer coefficients, and general form, each with a copy button.
The line, both points, the midpoint and a dashed rise/run step are drawn on an auto-scaled grid, along with any parallel or perpendicular line.
Give a start point, a slope or angle and a distance to get both possible end points, with the Δx and Δy working shown.
| Slope (rise/run) | Decimal | Angle | Grade |
|---|---|---|---|
| 1/12 | 0.0833 | 4.76° | 8.33% |
| 1/10 | 0.1 | 5.71° | 10% |
| 1/4 | 0.25 | 14.04° | 25% |
| 1/2 | 0.5 | 26.57° | 50% |
| √3/3 | 0.5774 | 30° | 57.74% |
| 3/4 | 0.75 | 36.87° | 75% |
| 1 | 1 | 45° | 100% |
| 4/3 | 1.3333 | 53.13° | 133.33% |
| √3 | 1.7321 | 60° | 173.21% |
| 2 | 2 | 63.43° | 200% |
| 5 | 5 | 78.69° | 500% |
A 1/12 slope (8.33%) is a common maximum for wheelchair ramps; check your local building code.
Subtract the y-values and divide by the difference of the x-values: m = (y₂ − y₁) / (x₂ − x₁). For (1, 2) and (4, 8) that is (8 − 2) / (4 − 1) = 6 / 3 = 2. It does not matter which point you call the first, as long as you subtract in the same order on the top and bottom.
Rise is the vertical change between two points (Δy) and run is the horizontal change (Δx). Slope is rise divided by run. A slope of 3/4 means the line goes up 3 units for every 4 units it moves to the right. A negative slope means it goes down as you move right.
A horizontal line has a slope of 0 because the rise is zero, and its equation is y = b. A vertical line has an undefined slope because the run is zero and you cannot divide by zero; its equation is x = a. The calculator detects both cases and writes the matching equation.
The angle of inclination is the arctangent of the slope: θ = arctan(m). A slope of 1 is 45°, a slope of 2 is about 63.43°, and a slope of 0.5 is about 26.57°. Negative slopes give negative angles, measured clockwise from the positive x-axis.
Multiply the slope by 100. A slope of 0.08 is an 8% grade, meaning 8 units of rise per 100 units of horizontal run. Grade is common for roads, ramps and drainage. A 100% grade is a 45° incline, not a vertical wall.
First find the slope m. Then find the y-intercept b by substituting one point into y = mx + b, so b = y₁ − m·x₁. For (1, 2) and (4, 8), m = 2 and b = 2 − 2 × 1 = 0, giving y = 2x. Point-slope form skips the intercept: y − y₁ = m(x − x₁).
Standard form is Ax + By = C, where A, B and C are integers and A is usually non-negative. The line y = −(6/5)x + 7/5 becomes 6x + 5y = 7 after multiplying through by 5 and moving the x term. Standard form also handles vertical lines, such as x = 3.
Perpendicular slopes are negative reciprocals: if one line has slope m, a perpendicular line has slope −1/m. A slope of 2 pairs with −1/2, and 3/4 pairs with −4/3. Their product is −1. Parallel lines have the same slope. A line perpendicular to a horizontal line is vertical.
Use the distance formula d = √((x₂ − x₁)² + (y₂ − y₁)²), which comes from the Pythagorean theorem. For (1, 2) and (4, 8) it is √(9 + 36) = √45 = 3√5 ≈ 6.708. The calculator simplifies the square root when it can and also gives the decimal.
Divide the distance by √(1 + m²) to get the horizontal step Δx, then multiply by the slope for Δy. From (0, 0) with slope 3/4 and distance 5, Δx = 5 / 1.25 = 4 and Δy = 3, so the point is (4, 3), or (−4, −3) in the opposite direction.
Add the Slope Calculator widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/slope-calculator"
title="Slope Calculator — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/slope-calculator?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>