Slope Calculator
Find the slope of the line through two points. Enter the x and y coordinates of both points to get the slope, line type, angle of inclination and the full line equation.
Find the Slope Between Two Points
Slope Formula
Where:
- \(m\) — slope of the line
- \((x_1, y_1)\) — coordinates of the first point
- \((x_2, y_2)\) — coordinates of the second point
The slope is the ratio of the rise (change in \(y\)) to the run (change in \(x\)), so it measures how steeply a line climbs or falls. A related value is the angle of inclination \(\theta\), found with the arctangent: \(\theta = \arctan(m)\).
Slope – Calculation Example
Example: find the slope of the line through the points \((2, 3)\) and \((6, 11)\).
\[ m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{11 - 3}{6 - 2} = \frac{8}{4} = 2 \]
\[ \theta = \arctan(2) \approx 63.4349° \]
\[ b = y_1 - m \cdot x_1 = 3 - 2 \times 2 = -1 \quad \Rightarrow \quad y = 2x - 1 \]
Result: the slope is \(m = 2\) — the line is increasing (it rises 2 units for every 1 unit it moves to the right), its inclination is about \(63.4349°\), and its equation is \(y = 2x - 1\).
How to Use the Slope Calculator
- Enter the x₁ coordinate and y₁ coordinate of the first point.
- Enter the x₂ coordinate and y₂ coordinate of the second point.
- Read the results: the Slope (m), the Line type (horizontal, vertical, increasing or decreasing), the Angle of inclination in degrees, and the Line equation in slope-intercept form.
- Check the How it was calculated section to see every intermediate step, which is handy for homework verification.
What Is Slope and How to Interpret It
The slope of a line describes its steepness and direction. Geometrically, it answers the question: “if I move 1 unit to the right along the line, how far up (or down) do I go?” The answer is the slope. A slope of \(2\) means the line rises 2 units for every 1 unit of horizontal movement; a slope of \(-0.5\) means it falls half a unit for every unit to the right.
The sign of the slope tells you the direction of the line:
- \(m > 0\) — the line is increasing: it rises from left to right.
- \(m < 0\) — the line is decreasing: it falls from left to right.
- \(m = 0\) — the line is horizontal: \(y\) never changes.
- \(m\) undefined — the line is vertical: \(x\) never changes, and the formula divides by zero.
The magnitude \(|m|\) measures steepness: the larger the absolute value, the steeper the line. The same idea also gives the angle of inclination \(\theta\) — the angle the line makes with the positive x-axis. A slope of 1 corresponds to \(45°\); slopes above 1 are steeper than \(45°\); slopes between 0 and 1 are gentler. Vertical lines have an inclination of \(90°\).
Besides the slope itself, the calculator builds the full slope-intercept equation \(y = mx + b\) by finding the y-intercept \(b = y_1 - m \cdot x_1\). This equation is satisfied by both input points, so you can use it to find \(y\) for any other \(x\) on the same line — for example when graphing or solving word problems about rates of change, such as speed, cost per unit, or growth per hour.
Assumptions, Limitations and Tips
- Order of points does not matter. Swapping point 1 and point 2 changes the signs of both rise and run, so the slope stays the same.
- Vertical lines have no slope. If \(x_1 = x_2\), the run is zero and the slope is undefined; the calculator reports this case explicitly along with the equation \(x = x_1\) and an inclination of \(90°\).
- Identical points are rejected. If both points are the same, infinitely many lines pass through them, so no unique slope exists.
- Decimals and negatives are fine. Use negative values for coordinates left of or below the origin; the calculator handles any real numbers.
- Slope vs. percentage grade. In road construction and roofing, “grade” is the slope expressed as a percentage: a slope of \(0.08\) is an 8% grade. Multiply the slope by 100 to convert.
- This calculator works for straight lines only. Curves such as parabolas have a slope that changes from point to point, which is a topic in calculus.
If you go on to work with linear systems, the Elimination Method calculator helps solve two line equations simultaneously, and parallel or proportional relationships between two variables can be checked with the Direct Variation calculator. For basic arithmetic practice behind the formula, see the Division and Subtraction calculators.
Frequently Asked Questions
What is the formula for slope and how do I calculate it by hand?
The slope formula is \( m = \frac{y_2 - y_1}{x_2 - x_1} \), often remembered as "rise over run." Subtract the y-coordinates to get the rise, subtract the x-coordinates to get the run, then divide. Be consistent: pick one point as point 1 and subtract its coordinates from point 2's in the same order for both numerator and denominator.
Can I plug the points into the formula in any order?
Yes, but stay consistent. If you swap which point is "point 1" and which is "point 2," both the rise and the run change sign, so the fraction stays the same. The mistake to avoid is mixing orders, e.g. computing \( (y_2 - y_1)/(x_1 - x_2) \) — that flips the sign of your answer.
How do I convert a slope to an angle in degrees?
Use the arctangent: \( \theta = \arctan(m) \) gives the angle in radians, so multiply by \( 180/\pi \) for degrees. A slope of 1 equals 45°, a slope of \( \sqrt{3} \approx 1.732 \) equals 60°, and a slope of 0 is 0°. To go the other way, \( m = \tan(\theta) \).
How do I convert slope to a percentage grade?
Multiply the slope by 100. A slope of 0.08 is an 8% grade, and a slope of 0.25 is a 25% grade — the convention used in roads, ramps, and roofing. Going backward, divide the percentage by 100. Note that grade percentages can exceed 100% when the slope is steeper than 45°.
What does it mean when the slope is undefined versus zero?
Zero slope means the line is perfectly horizontal — y never changes. Undefined slope means the line is vertical — x never changes, so the formula divides by zero. These are very different cases: a zero slope is a real number (0), while an undefined slope is not a number at all and cannot be used in \( y = mx + b \).
How can I tell if two lines are parallel or perpendicular from their slopes?
Two lines are parallel when their slopes are equal: \( m_1 = m_2 \). They are perpendicular when the product of their slopes is \(-1\): \( m_1 \cdot m_2 = -1 \), or equivalently \( m_2 = -1/m_1 \). For example, slopes 2 and \(-1/2\) describe perpendicular lines. Vertical and horizontal lines are always perpendicular to each other.
Does the slope formula work with decimal or negative coordinates?
Yes. The formula works for any real coordinates, including decimals, fractions, and negatives. With negative numbers, be careful with double negatives: subtracting a negative coordinate adds it. For instance, if \( y_2 = -3 \) and \( y_1 = -8 \), the rise is \( -3 - (-8) = 5 \).