Slope Calculator
Calculate the slope of a line from two coordinate points, or find a missing coordinate from one point and a known slope or angle. The calculator returns the slope, angle of inclination, percentage grade, rise, run, distance between points, both intercepts, the parallel and perpendicular slopes, and the line equation in all three standard forms.
Formula
Worked example
From (1, 2) to (4, 8): rise = 8 − 2 = 6, run = 4 − 1 = 3, slope = 6/3 = 2, angle = arctan(2) = 63.43°, grade = 200%, distance = √(9+36) = 6.708, y-intercept = 2 − 2(1) = 0, equation: y = 2x.
How slope is calculated from two points
Slope measures how steeply a straight line rises or falls in a coordinate plane. The formula is m = (y₂ − y₁) / (x₂ − x₁), where the numerator is the rise (vertical change) and the denominator is the run (horizontal change). A positive result means the line climbs from left to right; a negative result means it descends. When both x-values are identical the run is zero and the slope is undefined because you cannot divide by zero, indicating a perfectly vertical line.
Three calculation modes
The calculator offers three ways to define a line. In "two known points" mode you enter both coordinate pairs and all outputs are derived from the slope formula. In "one point and slope" mode you supply a starting point, the slope, and a horizontal run; the calculator locates the second point and derives every other output from those values. In "one point and angle" mode you enter a starting point, the angle of inclination in degrees, and a horizontal run; the slope is recovered as the tangent of that angle. All three modes produce the same complete output set.
Percentage grade and angle of inclination
Percentage grade expresses slope as a percentage: multiply the slope by 100. A grade of 100% corresponds to an exact 45° angle; typical road grades stay below 12%. The angle of inclination is the inverse tangent of the slope, bounded between -90° and 90°. These two outputs are especially useful in civil engineering, cycling route analysis, and accessibility ramp design, where steepness must stay within code limits.
Line equation in three forms
Every non-vertical line can be written in slope-intercept form (y = mx + b), point-slope form (y − y₁ = m(x − x₁)), or standard form (Ax + By = C). Slope-intercept form is the most readable for graphing because m and b appear explicitly. Point-slope form is convenient when you know a point on the line and want to avoid computing the intercept first. Standard form is used in systems of equations because both variables appear on the same side. The calculator derives all three automatically and also reports the x-intercept (where the line crosses the x-axis, i.e., where y = 0).
Parallel and perpendicular slopes
Two lines are parallel when they share the same slope and perpendicular when their slopes multiply to −1. If the slope of your line is m, any parallel line has slope m and any perpendicular line has slope −1/m. The calculator reports both so you can immediately write the equation of a related line through any point. This is a common task in geometry proofs, CAD work, and coordinate-grid problems.
Distance between the two points
The straight-line distance between the two points is d = √(Δx² + Δy²), a direct application of the Pythagorean theorem treating the rise and run as the legs of a right triangle. Knowing the distance is useful when the points represent real locations on a scaled map or engineering drawing, where slope gives direction and distance gives magnitude.
Limitations
This calculator is built for straight lines in two-dimensional Euclidean space; it does not compute slope for curves, parametric paths, or three-dimensional vectors. The angle output is bounded between −90° and 90° (exclusive) because slope is undefined at exactly ±90°. Floating-point precision in the inputs can introduce small rounding differences in the angle when the slope is very large or very small. For statistical regression slopes across many data points, a least-squares regression tool is the appropriate alternative.
Slope types and their meanings
| Slope value | Type | Angle | What it looks like |
|---|---|---|---|
| m = 0 | Horizontal | 0° | Flat line, no rise |
| 0 < m < 1 | Gentle positive | 0° to 45° | Rises slowly left to right |
| m = 1 | Unit positive | 45° | Rises one unit per unit run |
| m > 1 | Steep positive | 45° to 90° | Rises sharply left to right |
| -1 < m < 0 | Gentle negative | -45° to 0° | Falls slowly left to right |
| m = -1 | Unit negative | -45° | Falls one unit per unit run |
| m < -1 | Steep negative | -90° to -45° | Falls sharply left to right |
| undefined | Vertical | ±90° | No slope, x is constant |
The sign and magnitude of a slope tell you both the direction and steepness of a line.
Frequently asked questions
What does it mean when the slope is undefined?
An undefined slope occurs when both points share the same x-coordinate, making the run zero. Division by zero is not defined in standard arithmetic, so the slope has no finite value. This is distinct from a slope of zero, which describes a perfectly horizontal line and is well-defined.
How is percentage grade different from slope?
Percentage grade is the slope multiplied by 100. A slope of 0.12 is a 12% grade, which is the typical maximum for public roads. A 100% grade is exactly a 45° angle. Engineers and surveyors often prefer percentage grade because it is easier to read on field stakes.
What is the perpendicular slope used for?
The perpendicular slope (negative reciprocal of m) is the slope of any line that crosses the original at a 90° angle. This is needed when constructing normals to a curve, drawing altitude lines in triangles, or checking that two walls or edges in a design meet at a right angle.
Can slope be negative, and what does that indicate?
Yes, slope can be any real number. A negative slope means the line descends from left to right: for every unit you move in the positive x-direction, the y-value decreases. The steeper the descent, the larger the absolute value of the negative slope.
How is the angle of inclination related to slope?
The angle θ is the angle the line makes with the positive x-axis, measured counterclockwise. It is calculated as θ = arctan(m). Because arctangent returns values strictly between −90° and 90°, the inclination angle of any non-vertical line falls within that range.
What is the difference between slope-intercept, point-slope, and standard form?
Slope-intercept form (y = mx + b) is best for graphing because you can immediately read off the slope and the y-intercept. Point-slope form (y − y₁ = m(x − x₁)) is best when you know a specific point and the slope but have not calculated the y-intercept. Standard form (Ax + By = C) is most useful in linear systems because both variables are on one side, making elimination methods straightforward.
How do I find a missing coordinate using one point and a slope?
Switch the calculator to "One point + slope" mode. Enter your known point (x₁, y₁), the slope, and the horizontal distance (run) you want to travel. The calculator multiplies slope by run to get the rise, then adds both to the starting point to give you the second coordinate and the full line equation.