This slope calculator finds the exact slope and equation of a line from two points or standard-form coefficients.
How to find slope from two points
Slope measures signed vertical change divided by signed horizontal change. For points (x₁, y₁) and (x₂, y₂), m = (y₂ − y₁)/(x₂ − x₁), provided the x-coordinates differ. Keep each x-value paired with its y-value and subtract in the same order above and below the fraction. OpenStax Algebra and Trigonometry 2e gives this rise-over-run definition.
Choose Two points and enter both coordinate pairs. Signed integers, finite decimals and integer fractions are accepted. Write zero explicitly rather than leaving a field blank. Expressions, mixed numbers and scientific E notation are unsupported.
A positive slope rises as x increases; a negative slope falls. Reversing both point pairs changes the signs of rise and run together, so their ratio stays the same. Open Calculation details for the working, equation forms, graph and inclination.
Both input modes preserve reduced fractions. Decimal slope approximations use at most 12 significant digits; inclination uses at most 10 decimal places, with scientific notation for very small angles. Exact fractions determine the line type. If an approximate graph or angle cannot represent the exact line reliably, the calculator reports it unavailable.
Check a slope calculation step by step
Enter the points (-2, 3) and (4, 7).
Run: (4) − (-2) = 6.
Rise: (7) − (3) = 4.
Slope: m = (4) / (6) = 2/3.
y-intercept: 3 − (2/3) × (-2) = 13/3.
Line: y = 2/3x + 13/3.
The slope display is 2/3 (≈ 0.666666666667). Keep the fraction when writing the equation.
Write the equation of the line
Point-slope form is y − y₁ = m(x − x₁). Slope-intercept form is y = mx + b, where b = y₁ − mx₁. The y-intercept is where the line meets the y-axis. For the worked points, y-intercept: (0, 13/3). The same line has point-slope form y − (3) = (2/3)(x − (-2)) and standard form 2x - 3y = -13. These are equivalent descriptions, not different lines. OpenStax Algebra and Trigonometry 2e explains these forms.
Standard form Ax + By = C also describes vertical lines. The calculator reduces its coefficients to integers with no shared factor and chooses a positive first nonzero coefficient. A coefficient-mode point-slope result uses a labelled derived anchor, not an extra point you supplied.
To solve an equation for a single unknown rather than describe a coordinate line, use the Linear Equation Calculator.
Find slope from Ax + By = C
Choose Ax + By = C and enter A, B and C separately, including their signs. When B is nonzero, rearranging gives y = (−A/B)x + C/B. Thus m = −A/B and the y-intercept value is C/B. This follows the slope-intercept form in OpenStax Algebra and Trigonometry 2e.
For A = 3, B = -6 and C = 12, the engine working is m = −(3) / (-6) = 1/2; intercept = (12) / (-6) = -2. The resulting line is y = 1/2x - 2, with normalized standard form 1x - 2y = 4.
If B is zero and A is nonzero, the equation is the vertical line x = C/A. If A and B are both zero, the equation does not define a unique line; the calculator rejects it.
Compare parallel and perpendicular lines
Distinct nonvertical parallel lines have equal slopes and different intercepts. Equal slopes alone are not enough: equal intercepts describe the same line. Distinct vertical lines are parallel. For nonvertical perpendicular lines, the slopes multiply to -1; a horizontal line and a vertical line are also perpendicular. OpenStax Algebra and Trigonometry 2e states these relationships.
This calculator describes one line at a time. To find a shared intersection or distinguish inconsistent and dependent equations, enter them together in the System of Equations Calculator.
Zero slope, undefined slope and identical points
When the y-coordinates agree and the x-coordinates differ, rise is zero and the line is horizontal. Its slope is zero. When the x-coordinates agree and the y-coordinates differ, run is zero and the line is vertical. Its slope is undefined because division by zero is not defined, but its equation x = constant remains valid. OpenStax Algebra and Trigonometry 2e distinguishes these cases.
A vertical line away from the y-axis has no y-intercept. The y-axis itself consists entirely of intercept points; it has no single y-intercept. If both supplied points are identical, they do not determine a unique line. Enter a distinct point instead of interpreting that input as a horizontal or vertical result.
Read the angle of inclination
Inclination measures the positive angle from the positive x-axis to the line, as explained by Cosumnes River College Math 375: Pre-Calculus. This calculator chooses 0° for a horizontal line and uses angles from 0° up to, but excluding, 180°. A vertical line has inclination 90°. For a finite positive slope, use arctan(m); for a negative slope, add 180° to the negative arctangent angle.
The degree/ relationship is 180° = π , as defined in Katherine Yoshiwara, Trigonometry. The displayed inclination is in degrees. For the worked coordinate example, Inclination ≈ 33.690067526°. Equal axis scales; measured from the positive x-axis, from 0° up to but excluding 180°.
Equal axis scales are essential when interpreting the drawn angle. Rounding an angle near a horizontal or vertical direction does not change the exact line classification.
What a two-point slope can tell you
Two distinct points determine a straight line. If the points lie on a curve, their slope describes the secant between them; it does not calculate the derivative or establish the tangent at either point. The graph shows the infinite line clipped to its display window, not just a segment joining the supplied points. Its coordinates are approximate; the exact equations remain the result to use.
Calculator Campus limits each raw number to 256 characters and each integer component to 64 digits, including leading zeros. These are software resource limits. Excess precision is rejected rather than truncated. Finite decimals are treated as exact entered values, not measured values with inferred uncertainty.
The tool does not convert slope percentages or grade ratios, calculate distance or midpoint, or assess roof, ramp, drainage or structural requirements. If the axes represent different quantities or scales, interpret the ratio in those quantities; the displayed geometric angle assumes equal scales.
Slope describes direction. To find the length of the segment and its midpoint from the same Cartesian point pairs, enter them in the Coordinate Distance Calculator.