Slope Calculator

Free, with no sign up. Calculations run on your device; your entries stay in this browser.

Enter two distinct points using one common length unit. Each coordinate must be between −1,000,000,000 and 1,000,000,000 (±10⁹). Slope is unitless; the intercept, distance and midpoint use the selected length unit. Inclination is measured counterclockwise from the positive x axis between 0° and 180° (excluding 180°). Geometry results use floating-point arithmetic and may be approximate. Numeric summaries show up to 12 significant digits; line equations retain the engine’s floating-point precision.

Your result

Enter values and select Calculate.

m = (y₂ − y₁)/(x₂ − x₁); b = y₁ − mx₁; y − y₁ = m(x − x₁); distance = √(Δx² + Δy²); midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2); inclination = atan2(Δy, Δx) modulo 180°.

Primary source: OpenStax College Algebra 2e, coordinates, distance and midpoint; OpenStax College Algebra 2e, equations of lines.

Worked example

For (1, 2) and (4, 6), m = 4/3 and b = 2/3. The distance is 5 units; the midpoint is (2.5, 4). The inclination is about 53.1301023542°. Point-slope form: y − 2 = (4/3)(x − 1).

How to use this tool

Enter your measured values and select Calculate to see the result, formula and details below.

Frequently asked questions

What happens with a vertical line?

When the x coordinates match and y coordinates differ, the equation is x = x₁. Slope and y-intercept are undefined; distance, midpoint and the 90° inclination still appear.

Can the two points be identical?

No. Identical points do not define a unique line, so the calculator asks for distinct points.

Which angle does this calculate?

The inclination of the undirected line from the positive x axis, modulo 180°. A descending line has an inclination greater than 90°.