Slope Calculator
Free Slope Calculator: enter two coordinate points to instantly find the slope (gradient), line equation (y = mx + b), angle of inclination, distance, and...
????? ???? ??? ?????
How to Use the Slope Calculator
Enter the x and y coordinates of two points on a line, then click Calculate Slope. The calculator instantly shows the slope (gradient), the full line equation in slope-intercept form (y = mx + b), the angle of inclination in degrees, the straight-line distance between the points, and their midpoint. An interactive SVG coordinate graph visualizes the line, rise, and run.
Step-by-Step Instructions
- Enter Point 1 — type the x₁ and y₁ coordinates of your first point.
- Enter Point 2 — type the x₂ and y₂ coordinates of your second point.
- Click Calculate Slope — all results appear with a live coordinate graph.
- Use quick presets — try built-in examples to understand different slope types.
- Copy any result — click a KPI tile to copy that value to the clipboard.
The Slope Formula Explained

The slope of a line measures its steepness — how much the line rises or falls for every unit it moves horizontally. The slope formula uses two coordinate points to compute this ratio:
m = (y₂ − y₁) / (x₂ − x₁) = rise / run
Where rise is the vertical change (y₂ − y₁) and run is the horizontal change (x₂ − x₁). The result m is the slope — a single number that encodes everything about the line's direction and steepness.
The Components
- Rise (Δy): The vertical change from Point 1 to Point 2. Positive means going up, negative means going down.
- Run (Δx): The horizontal change from Point 1 to Point 2. Positive means going right, negative means going left.
- Slope (m): The ratio of rise to run. A slope of 2 means the line rises 2 units for every 1 unit it moves right.
- Y-intercept (b): Where the line crosses the y-axis. Calculated as b = y₁ − m·x₁.
Worked Example: Points (1, 2) and (4, 8)
- Rise: y₂ − y₁ = 8 − 2 = 6
- Run: x₂ − x₁ = 4 − 1 = 3
- Slope: m = 6 / 3 = 2
- Y-intercept: b = 2 − 2×1 = 0
- Line equation: y = 2x + 0 → y = 2x
- Verify: When x = 4: y = 2×4 = 8 ✓
Types of Slope

Slope values fall into four fundamental categories, each describing a distinctly different kind of line:
- Positive slope (m > 0): The line rises from left to right. The steeper the line, the larger the positive value. A slope of 0.1 is nearly flat; a slope of 10 is almost vertical. This is the most common slope in growth scenarios — rising revenue, increasing temperature, climbing elevation.
- Negative slope (m < 0): The line falls from left to right. A slope of −1 means for every unit right, the line drops exactly 1 unit. Models decline, decay, cost reduction, or any decreasing relationship between two variables.
- Zero slope (m = 0): A perfectly horizontal line. The y-value is constant regardless of x. Represents no change — a flat salary, constant speed, or a horizontal terrain feature.
- Undefined slope: A perfectly vertical line — x₁ = x₂. Since the run equals zero, the slope formula produces division by zero, which is undefined. Vertical lines cannot be expressed as y = mx + b; they are written as x = c (a constant).
Related Concepts: Angle, Distance, and Midpoint
Angle of Inclination
The angle θ that a line makes with the positive x-axis (measured counter-clockwise) is related to the slope by the equation: θ = arctan(m). This gives the angle in radians; multiply by 180/π to convert to degrees. A slope of 1 gives a 45° angle. Very steep lines approach 90°. Horizontal lines are 0°.
Distance Between Two Points
The straight-line (Euclidean) distance between two points is calculated using the Pythagorean theorem applied to the rise and run: d = √[(x₂ − x₁)² + (y₂ − y₁)²]. This is the length of the line segment connecting the two points.
Midpoint
The midpoint of the line segment between two points is: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). It is the point equidistant from both endpoints along the segment.
Parallel and Perpendicular Lines
Two lines are parallel if and only if they have equal slopes (m₁ = m₂). They never intersect. Two lines are perpendicular if and only if their slopes are negative reciprocals: m₁ × m₂ = −1, or equivalently m₂ = −1/m₁. They intersect at exactly one point, forming a 90° angle. A horizontal line (m = 0) is perpendicular to a vertical line (undefined slope) — a special case where the negative reciprocal rule still holds conceptually.
Real-World Applications of Slope
Slope is one of the most widely applied concepts in mathematics, science, and engineering:
- Road engineering: Road grade is expressed as the slope of the road surface, typically as a percentage (rise/run × 100). A 6% grade means the road rises 6 feet per 100 feet of horizontal distance. Highway standards limit grades for safety — steep grades stress brakes and engines.
- Architecture and construction: Roof pitch is a slope ratio (e.g., "4 in 12" means a rise of 4 inches for every 12-inch run). Ramp gradients for ADA accessibility must not exceed 1:12 (slope ≈ 0.083). Drainage slopes prevent water pooling.
- Physics — velocity and acceleration: On a distance-time graph, slope represents velocity. On a velocity-time graph, slope represents acceleration. The steeper the slope, the faster the change. This is why calculus defines the derivative as the instantaneous slope of any curve.
- Economics — cost and revenue: Marginal cost, marginal revenue, and price elasticity are all expressed as slopes on economic graphs. The supply curve's positive slope and demand curve's negative slope encode fundamental economic behavior.
- Data science and statistics: Linear regression finds the best-fit line through data points, expressed as ŷ = mx + b. The slope m represents the relationship between the predictor and outcome variable — a slope of 0.3 on a salary/experience graph means $300 more for each additional year.
- Geography and navigation: Topographic maps use contour lines to show elevation change. Slope between two elevation contours determines trail difficulty, avalanche risk, and water flow direction. GPS systems compute slopes for routing and grade display.
Slope-Intercept, Point-Slope, and Standard Form
A linear equation can be written in three standard forms, each useful in different contexts:
- Slope-intercept form: y = mx + b — the most common form. Directly shows the slope m and y-intercept b. Easy to graph: start at (0, b) and use slope to find other points.
- Point-slope form: y − y₁ = m(x − x₁) — most useful when you know the slope and one point but not the y-intercept. Exactly what this calculator computes first.
- Standard form: Ax + By = C — useful for systems of equations and some algebraic manipulations. No fractions in integer form. Convert from y = mx + b by rearranging.
Related Math Calculators
Slope connects directly to several other fundamental mathematical tools:
- Percentage Calculator — Slope is often expressed as a percentage grade (slope × 100%). Use this calculator to convert slope values to percent form.
- Average Calculator — The slope of a regression line uses averages of x and y values. Understanding means is essential for interpreting linear models.
- Remainder Calculator — Integer arithmetic, divisibility, and modular relationships underlie coordinate geometry in discrete/digital contexts.