Slope Calculator
Calculate slope, line equations, angle of inclination, distance between points, intercepts, and graph visualizations with step-by-step coordinate-geometry solutions.
Slope From Two Points
Enter two (x, y) coordinates. Get the slope, angle of inclination, distance, midpoint, intercepts, and the line equation in four forms — with a full step-by-step solution.
Try an example
What is slope, and why does it matter?
The slope of a line — also called the gradient, grade, or incline — is the single number that captures how steeply a line rises or falls as you move along it. Slope is the bridge between algebra and geometry: it is the ratio at the heart of linear equations, the slope-intercept form, the point-slope form, and every coordinate proof in introductory geometry. The same concept underlies physical quantities like road grade, roof pitch, the steepness of a ski run, the strength of a trend line on a chart, and even the marginal rate of change in economics.
This tool pairs five focused calculators with a live coordinate-plane graph so you can solve the slope from two points, find a missing endpoint from a starting point and a distance, convert a line equation between four standard forms, analyze distance and direction, or explore coordinate geometry by dragging points directly on the plane. Each answer is shown with a full step-by-step solution and cross-linked to the other forms of the same line. For broader math help, see our scientific calculator and percentage calculator.
How the slope calculator works
Reads your inputs
Enter the coordinates of the two points (or a starting point plus a distance and slope/angle). Decimals, negatives, and simple fractions like 3/4 are all accepted.
Computes Δx, Δy, and slope
The calculator subtracts the x-coordinates to get Δx (the run) and the y-coordinates to get Δy (the rise), then divides — m = Δy / Δx.
Derives angle and distance
Angle of inclination comes from θ = arctan(m). Distance comes from the Pythagorean theorem d = √(Δx² + Δy²). Midpoint averages each coordinate independently.
Builds the line equation
Once the slope and one point are known, the calculator produces the line equation in slope-intercept, point-slope, standard, and general form — and computes both intercepts.
Five ways to use this slope calculator
Slope From Two Points
Enter two (x, y) coordinates. Get the slope, angle of inclination, distance, midpoint, intercepts, and the line equation in four forms — with a full step-by-step solution.
Point + Slope Calculator
Start from one point plus a distance and either the slope or the angle of inclination. The calculator returns both forward and backward endpoint solutions — the two valid points on the same line at that distance.
Line Equation Calculator
Build a line from slope and y-intercept, or from a point plus slope. Get the equation in slope-intercept, point-slope, standard (Ax + By = C), and general (Ax + By + C = 0) form.
Distance & Angle Calculator
Focus on the distance, angle, direction, and quadrant of the displacement vector from P₁ to P₂ — useful for navigation, surveying, and physics problems.
Coordinate Geometry Explorer
Drag the two points directly on the coordinate plane. Every value — slope, angle, distance, midpoint, intercepts, line equation — updates live as you move the points.
Core coordinate-geometry formulas
Every result on this page comes from one of the formulas below. Cross-reference them whenever you want to check a step by hand.
Slope
m = (y₂ − y₁) / (x₂ − x₁)
Rise over run. Subtract y-coordinates for the rise and x-coordinates for the run; divide.
Angle of Inclination
θ = arctan(m)
The angle the line makes with the positive x-axis. A slope of 1 is 45°; a vertical line is 90°.
Distance
d = √((x₂ − x₁)² + (y₂ − y₁)²)
The Pythagorean theorem applied to the Δx and Δy legs of the right triangle.
Midpoint
M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
The exact centre of the segment — the average of each coordinate.
Slope-Intercept
y = mx + b
Solve for b once you have the slope and one point: b = y₁ − m·x₁.
Point-Slope
y − y₁ = m(x − x₁)
Always available with one point and a slope — no need to compute the intercept first.
Best practices for slope problems
- ✓Stay consistent with the point order. Whichever point you call P₁, the same point's coordinates must go in the numerator and the denominator of the slope formula. Swapping mid-calculation is the most common student error.
- ✓Sketch before you solve. Even a rough mental sketch tells you whether to expect a positive, negative, zero, or undefined slope — and catches sign errors before they cascade.
- ✓Cross-check with the angle. Compare the slope with the angle of inclination — a slope of 1 should always read 45°, slope √3 should read 60°, and a vertical line should read 90°.
- ✓Use the right form for the question. Point-slope is fastest when you have one point. Slope-intercept is best for graphing. Standard form is the convention for linear-algebra and constraint problems.
- ✓Watch for vertical lines. A vertical line has undefined slope and is written as x = constant — it cannot be expressed in slope-intercept form. The calculator flags this for you automatically.
Why slope matters in the real world
Slope is one of those quietly universal ideas — it has the same algebraic form whether you are calculating a roof pitch for a contractor, a road grade for a traffic engineer, a marginal cost in economics, a velocity from a position graph in physics, or the rate at which a population, temperature, or revenue figure is changing. Every linear relationship in mathematics, science, and engineering can be reduced to a slope plus a starting value.
Even the angle of inclination shows up in surprising places — surveyors quote hillside angles to lay out roads safely, civil engineers express ramp slopes as degrees to satisfy ADA accessibility codes, roofers quote pitches as a 4-in-12 ratio that translates back to a roof-angle calculation, and skiers see slope percentage on every signed run. Getting comfortable with rise-over-run pays off far beyond the algebra classroom.
Tricky cases the calculator handles
Vertical lines (undefined slope)
When x₁ = x₂, Δx = 0 and the slope is undefined. The calculator reports 'undefined', sets the angle to 90°, and switches the equation to the x = constant form. Slope-intercept form does not exist for vertical lines.
Horizontal lines (zero slope)
When y₁ = y₂, Δy = 0 and the slope is exactly zero. The angle of inclination is 0°. The y-intercept is the same as the constant y-value; there is generally no x-intercept (unless the line lies along the x-axis itself).
Identical points
If both points coincide, no unique line passes through them. The calculator flags this and asks you to spread the points apart — distance is zero and slope is indeterminate.
Both endpoint solutions in Point + Slope mode
From one anchor point, a slope and a distance specify a line, not a single endpoint — there are always two valid endpoints, one in each direction. The calculator returns both so you can pick the one your problem needs.
Common slope mistakes (and how to avoid them)
Swapping the order of subtraction
If you write (y₂ − y₁) in the numerator, you must write (x₂ − x₁) in the denominator. Mix the order and the slope sign flips. The fix: always pick a P₁ and a P₂, then stick with that labelling all the way through.
Confusing Δx and Δy
Δy is the rise (the vertical change); Δx is the run (the horizontal change). Plotting them in the wrong slots gives the reciprocal of the correct slope — a classic algebra-test trap.
Forgetting to check for vertical lines
Dividing by Δx without checking that it isn't zero gives a runtime error or, worse, a silently wrong answer. The calculator handles this for you, but on paper you should always check Δx first.
Reading angle of inclination wrong
Negative slopes give angles in the (90°, 180°) range, not negative angles. The calculator normalizes the angle to 0°–180° (or 0°–360° for the Point + Slope mode where direction matters).
Built for students, teachers, engineers, and CAD designers.
Every formula on this page is the textbook coordinate-geometry definition. Calculations use double-precision floating-point — accurate to roughly 15 digits. See our methodology and editorial policy. Educational only — confirm safety-critical engineering or surveying figures with a licensed professional.
Frequently asked questions
Related Calculators
Pair the slope calculator with these related tools for broader math and engineering work.
- Scientific CalculatorAdvanced trig, log, exponent, root, factorial, and memory functions.
- Percentage CalculatorCalculate % of a number, percentage change, and reverse percentages.
- Unit ConverterAll-in-one converter for 40+ measurement categories with natural-language input.
- Horsepower CalculatorHorsepower from torque & RPM, force-distance-time, watts, or vehicle trap-speed data.
- Stair CalculatorStair rise, run, angle, stringer, and IRC / IBC code checks with visual layouts.
- Roofing CalculatorRoof area, pitch, angle, shingles, underlayment, waste, and project cost with seven materials and live roof diagrams.