We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Quickly calculate the slope of a line by entering the coordinates of two points. Free online slope calculator for math and geometry.
Formulas
m = (y₂ − y₁) / (x₂ − x₁)
Distance Between Two Points: d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Midpoint Coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Angle with Positive X-axis: θ = arctan(m)
When x₁ = x₂, the line is vertical and the slope is undefined. When y₁ = y₂, the line is horizontal and the slope is 0.
y = 2x-2x + y = 0y - 2 = 2 · (x - 1)Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Enter two points, (x₁, y₁) and (x₂, y₂), to find the slope of the line through them. Slope is vertical change divided by horizontal change, often called rise over run:
For A(1, 2) and B(4, 8), Δx = 3 and Δy = 6, so m = 6/3 = 2. Reversing the point order changes both differences’ signs, leaving the ratio unchanged. OpenStax explains the two-point slope formula.
The result also reports Δx and Δy, straight-line distance, midpoint, line angle, intercepts where defined, and several equation forms. With the example points, distance is √45 (about 6.708), midpoint is (2.5, 5), and the line is y = 2x. Positive slope means y rises as x increases; negative slope means it falls; a horizontal line has slope 0. If x₁ = x₂, the line is vertical and slope is undefined. If both coordinates match, the points do not determine one unique line.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Fill in x₁ and y₁ for the first point, then x₂ and y₂ for the second. Coordinates may be negative, decimal, or whole numbers.
Read the slope and coordinate changes first. For A(1, 2) and B(4, 8), rise is 6, run is 3, and slope is 2.
Use distance, midpoint, angle, intercept, and equation results to check other parts of a geometry problem. The page recalculates when coordinates change.
Copy a displayed result if needed, or reset the fields before another calculation.
Use cases
See how the tool fits into real work and everyday tasks.
Enter two given points and compare the rise, run, slope, and equation with your work. Substituting either point into the equation is a useful consistency check.
For two observations plotted as x and y, slope gives the change in y per unit change in x between those endpoints. If the full data set is not linear, this endpoint slope is not a fitted regression trend.
Q&A
Find concise answers to common questions and confusing cases.
Its x-coordinates are equal, so x₂ − x₁ is zero and the formula would divide by zero. The line can still be written as x equal to the shared coordinate.
A point repeated does not uniquely determine a line. The calculator marks the pair invalid instead of assigning a slope.
No. Numeric outputs are formatted as decimals, generally to at most six decimal places, with scientific notation for very small or large magnitudes. Keep the coordinate differences as a fraction when exact form matters.
Slope has y-units per x-unit when the axes use units. It is unitless only when those units cancel or the axes use the same unit.
Notes
Review scope, result limitations, and important precautions before use.
Displayed decimals are rounded for readability and may not preserve an exact fraction. Calculations use the browser’s numeric representation; unusually large values or exact decimal work can lose precision. Interpret slope with the definitions and units of your axes, especially when coordinates represent measurements.
Related
Discover related tools, collections, and available API capabilities.