Slope Calculator

By: Calculator Grid

Slope calculator

Find the slope, line equation, angle, percentage grade, intercept, coordinate changes, and distance between two points.

Direction Increasing Δx 6 Δy 1 Distance 6.082763
Workbook ready for the startup example.

Point coordinates

First point(x₁, y₁)

Required plain number, using a decimal point.

Required plain number, using a decimal point.

Second point(x₂, y₂)

Required plain number, using a decimal point.

Required plain number, using a decimal point.

Live results

Slope (m) 0.166667

y = 0.166667x + 4.833333

Y-intercept4.833333
Angle (θ)9.462322°
Percentage grade16.666667%
Distance (d)6.082763
m = (6 – 5) ÷ (7 – 1) = 1 ÷ 6
Slope 0.166667. The line is increasing.

Calculation details

Measure Value Meaning
Horizontal change (Δx) 6 The second x-coordinate minus the first.
Vertical change (Δy) 1 The second y-coordinate minus the first.
Slope (m) 0.166667 Vertical change divided by horizontal change.
Y-intercept 4.833333 The y-value where the line crosses x = 0.
Angle (θ) 9.462322° The signed angle from the positive x-axis, between – 90° and 90°.
Percentage grade 16.666667% Slope multiplied by 100.
Distance (d) 6.082763 The straight-line distance between the two points.

Coordinates are treated as dimensionless values. If your axes represent measured quantities, interpret slope units as “vertical units per horizontal unit.”

How to use this slope calculator

What this calculator does

This calculator determines the constant slope of the unique straight line through two points. It also reports the line equation, y-intercept, signed angle, percentage grade, horizontal change, vertical change, and straight-line distance. These outputs help describe direction and rate of change, but they do not establish causation, model a curved relationship, or decide whether two measured variables should be treated as linearly related. For a nonlinear function, the slope between two points is an average rate of change rather than a slope that applies everywhere.

When to use it

Use it when checking coordinate-geometry homework, converting two observations into a linear equation, estimating a constant rate such as distance per unit time, or describing the grade of a straight ramp or road segment. The same formula is introduced in the OpenStax treatment of linear functions and two-point equations.

How to calculate

  1. The calculator opens with the demonstration points (1, 5) and (7, 6), so the results and a validated example workbook are available immediately.
  2. Replace the four coordinate values with your own numbers. Use a decimal point for decimals; grouped thousands such as 1,250 are accepted, while decimal-comma input such as 1,5 is rejected to prevent ambiguity.
  3. Read Slope (m) first, then use Line equation, Y-intercept, Angle (θ), Percentage grade, Distance (d), and the Δx/Δy pills for context.
  4. Select Download Excel to export the current valid inputs and results as a real .xlsx workbook. Select Reset to clear the demonstration data. Reset intentionally leaves the fields empty and disables export until all four coordinates are valid again.

Input guide

x₁ coordinate and y₁ coordinate are the required horizontal and vertical coordinates of the first point. x₂ coordinate and y₂ coordinate are the required coordinates of the second point. Each field accepts a signed integer or decimal in plain U.S.-style notation, including examples such as – 2, 3.5, or 1,250.25. Values must be finite and no larger than 10100 in magnitude. Changing either y-value changes the rise; changing either x-value changes the run. A common mistake is swapping x and y within only one point, which describes a different line. Another is entering equal x-values and expecting a finite slope: distinct points with equal x-values define a vertical line, whose slope and percentage grade are undefined. If both entered points are identical, one point has simply been repeated and no unique line, angle, intercept, or grade can be determined.

Output guide

Slope (m) is Δy ÷ Δx, expressed as vertical units per horizontal unit. The Direction pill translates its sign into Increasing, Decreasing, Horizontal, or Vertical. Line equation is shown in slope-intercept form, y = mx + b, except for a vertical line, which is shown as x = constant. Y-intercept is b, the y-value at x = 0; it is undefined for a vertical line. Angle (θ) is arctan(m) in degrees, with vertical lines reported as 90°. Percentage grade is 100m, so a slope of 0.12 is a 12% grade. Horizontal change (Δx) and Vertical change (Δy) preserve sign, while Distance (d) is always nonnegative. The formula line beneath the cards shows the current coordinate substitution. In Calculation details, the Measure column names each result, Value shows the rounded output, and Meaning explains its interpretation. These are exact mathematical identities based on the entered points, subject only to displayed decimal rounding.

Worked example

For the startup points (1, 5) and (7, 6), Δx = 7 – 1 = 6 and Δy = 6 – 5 = 1. Therefore m = 1 ÷ 6 = 0.166667 after display rounding. The intercept is b = 5 – (1/6 × 1) = 4.833333, producing y = 0.166667x + 4.833333. The angle is arctan(1/6) = 9.462322°, the grade is 16.666667%, and the distance is √(6² + 1²) = √37 = 6.082763. The startup workbook uses these same canonical values rather than copying rounded text from the page.

How slope works

The slope formula is m = (y₂ – y₁) / (x₂ – x₁). Subtracting in the same point order is essential: if you reverse both differences, both signs change and the quotient stays the same. Reversing only one difference incorrectly changes the sign. The formula measures the change in the vertical coordinate for one unit of horizontal change.

A horizontal line has Δy = 0 and therefore slope 0. A vertical line through two distinct points has Δx = 0, so ordinary division is impossible and the slope is undefined. If both points coincide, both differences are zero and there is no unique line to describe. For additional practice recognizing and calculating slopes, see Khan Academy's slope formula lesson.

Units matter: if x is time in seconds and y is distance in meters, slope is meters per second. If both axes use the same length unit, the ratio is dimensionless and can be expressed as a percentage grade.

Interpreting the extra results

The y-intercept is useful for writing a complete linear model, but it may fall outside the observed x-range and should not automatically be treated as a meaningful real-world starting value. The angle gives a geometric description of orientation. Percentage grade is common in construction and transportation contexts, but it is rise divided by horizontal run – not rise divided by the sloped distance. Distance is independent of direction because it uses squared coordinate changes.

When two points come from a curved function, this calculator returns the secant-line slope between them. That is the average rate of change over the interval, as explained in Wolfram MathWorld's average rate of change reference. A tangent slope at one point requires differentiation or a suitable numerical approximation.

Common mistakes

  • Using y₂ – y₁ in the numerator but x₁ – x₂ in the denominator, which reverses the sign.
  • Treating an undefined vertical slope as zero. Zero describes a horizontal line; vertical and horizontal are different cases.
  • Reading a 0.12 slope as 0.12%. The equivalent percentage grade is 12%.
  • Assuming a visually steep line must have a large numerical slope without checking the graph's axis scales and units.