Slope Calculator
MathCalculate the slope, y-intercept, angle, and equation of a line between two points. Enter coordinates (x₁, y₁) and (x₂, y₂) to get the line equation instantly. Free tool.
Point 1
(2, 3)
Point 2
(6, 11)
Slope (m)
Line Equation
y = 0x
Y-Intercept (b)
0
Angle (θ)
0°
Distance
0
Direction
↘ Falling
What is a Slope?
The Slope Calculator computes the slope, y-intercept, angle of inclination, and distance between two points from a pair of (x, y) coordinates. It then builds the full linear equation in slope-intercept form (y = mx + b) or handles the special vertical-line case (x = c), and shows whether the line is rising, falling, horizontal, or vertical.
Slope (gradient) is the fundamental measure of a line's steepness: it quantifies how many units the line rises or falls for every one unit of horizontal movement. A slope of 3 means the line climbs 3 units for each unit right; a slope of −0.5 means it falls 0.5 units per unit right. Slope is the building block of all linear relationships in mathematics and data analysis — the coefficient m in y = mx + b is the slope, and it appears in every linear regression model, rate-of-change calculation, and coordinate geometry problem.
In Indian school mathematics, slope is a central topic in CBSE Class 11 (Chapter 10: Straight Lines) and is a prerequisite for calculus (the derivative of a function at a point is the slope of the tangent line). It appears in JEE Main and Advanced coordinate geometry problems involving conditions for parallelism, perpendicularity, angle between lines, and finding the equation of a line given various conditions.
The Pythagorean Theorem Calculator is a natural companion — the distance between two points is the hypotenuse of the right triangle formed by the coordinate differences, and the slope's angle of inclination θ = arctan(m) relates directly to the triangle's trigonometry.
How to use this Slope calculator
Enter Point 1 coordinates — type the x₁ and y₁ values. Accepts positive, negative, and decimal values. For the origin, enter (0, 0).
Enter Point 2 coordinates — type x₂ and y₂. Ensure the two points are different (x₁ ≠ x₂ or y₁ ≠ y₂); entering the same point twice is undefined.
Read the Slope — the primary result card shows slope m to four decimal places (or "Undefined" for a vertical line). Check the direction label to confirm the sign is as expected.
Read the Equation — the linear equation y = mx + b (or x = c) is displayed. Use this to evaluate y at any x, or to find the intersection with another line by solving simultaneously.
Check Angle and Distance — the inclination angle and point-to-point distance appear in secondary cards. The angle is useful for physical slope contexts (ramps, roads, roof pitch). The distance is useful for any problem involving the length of the line segment between your two points.
Formula & Methodology
Slope:m = (y₂ − y₁) / (x₂ − x₁)[Undefined if x₁ = x₂] Y-Intercept:b = y₁ − m × x₁ Angle of Inclination:θ = arctan(m) in degrees[θ = 90° for vertical lines] Distance between Points:d = √((x₂ − x₁)² + (y₂ − y₁)²) Line Equation:Slope-intercept: y = mx + bVertical line: x = x₁ Worked example — finding the slope of a road gradient: A road survey measures two points on a road: (0, 0) and (200, 14) in metres (x = horizontal distance, y = elevation). Step 1 — Slope:m = (14 − 0) / (200 − 0) = 14/200 = 0.07 Step 2 — Gradient percentage: 0.07 × 100 = 7% gradient (the road rises 7 m per 100 m horizontal — steep for Indian highway standards, which typically cap at 5–6% in hilly terrain) Step 3 — Angle of inclination:θ = arctan(0.07) ≈ 4.00° Step 4 — Distance along road (the actual road length, not just horizontal):d = √(200² + 14²) = √(40000 + 196) = √40196 ≈ 200.49 m Step 5 — Line equation:y = 0.07x + 0 → y = 0.07x (the road passes through the origin) Assumption: The slope formula assumes a straight line (linear relationship) between the two points. For curved paths (curves, arcs, or non-linear functions), the slope between two points is the secant slope — the instantaneous slope at a single point requires calculus (the derivative). Coordinates can be in any consistent unit — metres, kilometres, or dimensionless values — as long as both axes use the same unit.