Quickly find the slope of a line from two points with this Slope Calculator. Enter coordinates, press calculate, and instantly see the slope, the line equation, and more.
What is slope?
The slope of a line measures its steepness and direction. It’s defined as the ratio of the change in y to the change in x between two points on the line. Mathematically, slope m is computed as m = (y? ? y?) / (x? ? x?). A positive slope rises as you move right, a negative slope falls, a zero slope is horizontal, and an undefined slope corresponds to a vertical line.
How to use the Slope Calculator
- Enter the first point (x?, y?).
- Enter the second point (x?, y?).
- Optionally choose how many decimal places to round to.
- Click Calculate Slope to see results instantly.
The calculator returns the slope, the change in x and y (?x and ?y), the angle of the line in degrees (relative to the positive x-axis), and the line equation in slope-intercept form when applicable.
Formula and interpretation
The core formula is straightforward: m = ?y / ?x. Here, ?y = y? ? y? and ?x = x? ? x?. If ?x = 0, the line is vertical and the slope is undefined. If ?y = 0, the slope is 0 and the line is horizontal. The angle ? of the line with respect to the x-axis can be found using ? = arctan(m), reported in degrees.
Examples
- Points (1, 2) and (4, 8): ?y = 6, ?x = 3, so m = 6/3 = 2. The line rises 2 units for every 1 unit to the right.
- Points (?3, 5) and (?3, ?1): ?x = 0, so the line is vertical and slope is undefined. The equation is x = ?3.
- Points (0, 7) and (5, 7): ?y = 0, so m = 0. The line is horizontal with equation y = 7.
Line equation from two points
Once you know the slope m, you can write the equation in slope-intercept form y = mx + b. Solve for b using either point: b = y? ? m·x?. For vertical lines (x? = x?), the slope-intercept form doesn’t apply; instead, use x = c, where c is the shared x-value.
Why use this Slope Calculator?
- Fast and accurate slope from any two points.
- Clear display of ?x, ?y, angle, and line equation.
- Adjustable rounding to match classroom or professional standards.
- Helpful notes for special cases like vertical and horizontal lines.
Tips for accurate inputs
- Avoid identical x-values if you need a numeric slope; that produces a vertical line.
- Double-check signs on negative coordinates.
- Use more decimal places for engineering or scientific precision.
Common applications
Slope appears in algebra, calculus, physics, engineering, and data analysis. It’s used to describe rates of change, grade (steepness) of roads and roofs, trend lines in statistics, and projectile motion trajectories. Whether you’re graphing a line, analyzing a dataset, or checking a ramp’s incline, knowing how to compute and interpret slope is essential.
Frequently encountered edge cases
Vertical lines (x? = x?) are common when two points share the same x-coordinate; their slope is undefined, and the equation is x = c. Horizontal lines (y? = y?) produce slope 0 with equation y = c. For very small ?x values, slope can be extremely large in magnitude; consider increasing decimal precision to reduce rounding error.