Tools / Math / Slope calculator
A clearer way to understand your line.
Find slope from two points or a line equation, explore parallel and perpendicular lines, and convert between slope, angle and percentage grade. See the working and a graph of your answer.
Start with what you know
Choose a calculation
Your answer
Slope of the line
m = 4/3
IncreasingInputs changed. Calculate again to update the answer, graph and downloads.
See the geometry
Interactive line graph
Drag with a mouse to pan. On touch devices, use the controls above. Focus the graph and use arrow keys to pan, +/− to zoom, or R to fit. Grid squares use equal x and y scales.
Same line, different forms
Equations & geometry
Follow the method
Step-by-step solution
Fractions are exact for rational inputs. Angles, square-root distances and distance-mode endpoint coordinates are rounded approximations.
How to use this slope calculator
- Select the calculation mode that matches your information.
- Enter your values. A fraction such as 3/4 is accepted directly; you do not need to round it first.
- Select Calculate slope. Read the slope, decimal value, angle and percentage grade.
- Check the equations and steps, then explore the graph. Copy the solution or download a text report or SVG graph.
For two points, enter x₁, y₁, x₂ and y₂. For a line equation, enter a linear expression such as 2x + 3y = 6, y = (2/3)x − 4 or x = 5. Point + slope also accepts the word vertical as the slope. The distance mode finds the two possible endpoints at a specified straight-line distance from a starting point.
What is slope?
Slope measures the change in y for each one-unit increase in x. A slope of 2 means that moving one unit to the right raises the line by two units. A slope of −2 means the line falls by two units for the same horizontal movement.
The numerator is the vertical change, Δy. The denominator is the horizontal change, Δx. Keep the point order consistent: if you subtract the first point from the second in the numerator, do the same in the denominator. Reversing both orders gives the same slope.
Positive, negative, zero and undefined slope
| Slope | What the line does | Example |
|---|---|---|
| Positive | Rises from left to right | y = 2x + 1 |
| Negative | Falls from left to right | y = −2x + 1 |
| Zero | Stays horizontal | y = 4 |
| Undefined | Stays vertical | x = 4 |
A vertical line has zero run. Its slope is undefined because division by zero is not defined. A horizontal line has zero rise and a nonzero run, so its slope is exactly zero. Two identical points are different: they do not identify one unique line, so this calculator asks you to change a coordinate.
A worked slope example
Take P₁ = (3, 4) and P₂ = (6, 8). The run is 6 − 3 = 3 and the rise is 8 − 4 = 4, giving m = 4/3 ≈ 1.333333. The line equation is y = (4/3)x. The midpoint is (4.5, 6), and the straight-line distance is √(3² + 4²) = 5 units. Its inclination is approximately 53.130102°.
For a falling line through (−2, 5) and (4, −1), the rise is −6 and the run is 6, so m = −1. Its signed slope angle is −45°, while its inclination measured counterclockwise from the positive x-axis is 135°. Both describe the same line direction under different angle conventions.
Slope, angle and percentage grade
The signed slope angle is arctan(m), between −90° and 90°. Line inclination is reported from 0° up to, but not including, 180°. A negative slope therefore has a negative signed angle but an inclination above 90°. A vertical line has inclination 90° and undefined percentage grade.
A 100% grade is a 45° slope, not a 90° slope. Grade compares vertical change with horizontal change, not with the length along the sloping line. Use the same units for rise and run. For practical surveying or design work, check the relevant measurement method and standards; this is a straight-line geometry tool.
Find a line from an equation or a point
In slope-intercept form, y = mx + b, m is the slope and b is the y-intercept. In standard form, Ax + By = C, the slope is −A/B when B is nonzero. If B = 0 and A is nonzero, the line is vertical.
Given a point (x₁, y₁) and slope m, use y − y₁ = m(x − x₁). The calculator rearranges this into the other line forms. It also reports the x-intercept and y-intercept, including the special cases where an entire axis lies on the line.
Parallel and perpendicular lines
Parallel lines share the same slope, with vertical lines handled separately. Nonvertical, nonhorizontal perpendicular lines have slopes whose product is −1. The perpendicular to a horizontal line is vertical, and the perpendicular to a vertical line is horizontal. Enter a reference equation and a point to find the required line through that point.
Point, slope and distance
A line and a positive distance from a starting point give two possible endpoints. For a finite slope m, multiply the unit direction vector (1, m)/√(1 + m²) by the distance, then add or subtract the result from the starting point. Angle input uses (cos θ, sin θ). The graph displays both endpoint choices.
Frequently asked questions
Can I enter fractions and negative coordinates?
Yes. Enter values such as −3/4, 0.125, −12 or 1e-3. Rational inputs are calculated with exact fraction arithmetic. Inputs may have up to 12 decimal places and a magnitude up to one trillion; complex expressions belong in Line equation mode.
Can the calculator parse any equation?
It parses linear equations in x and y with addition, subtraction, multiplication, division by constants, and parentheses. For example, 2(x + y) = 6 works. Powers, trigonometric functions, products such as xy and division by a variable are outside this tool’s scope.
Why is the slope undefined when both x-coordinates are equal?
Different points with the same x-coordinate form a vertical line. The run is zero, so the slope formula would divide by zero. The calculator shows x = a and draws the vertical line instead of reporting an ordinary finite slope.
Why does point + distance mode show two answers?
Two points on the line are the same positive distance from your starting point: one in each direction. Unless an additional direction is specified, both are valid endpoint choices. A zero or negative distance is not accepted in this mode.
Is percentage grade the same as degrees?
No. Grade is 100 times rise/run, while degrees describe an angle. Convert with grade = 100 tan(θ). A 45° angle corresponds to 100% grade.
Are the graph and decimals exact?
Exact fraction results are preserved for rational inputs. The graph uses floating-point coordinates, and angles, distances and trigonometric conversions are numerical approximations. The precision control changes decimal display, not the underlying rational calculation.
Are my inputs uploaded?
The calculator runs in your browser without a solving API. The tool does not send its inputs to a solving service or save them in the page URL. Normal website traffic remains subject to ThinkQuarry’s privacy policy.