Distance Formula Calculator

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

Calculate straight-line Euclidean distance in a plane, using two distinct points. This is not route or map distance. 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.

distance = √((x₂ − x₁)² + (y₂ − y₁)²). 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), distance = √((4 − 1)² + (6 − 2)²) = √25 = 5 units. For (−2, 3) and (−2, 9), distance = √(0² + 6²) = 6 units even though the line is vertical.

How to use this tool

Enter both x and y coordinates for two distinct points, choose their shared length unit, then select Calculate. Distance appears first; midpoint and line context follow.

Frequently asked questions

What distance does this calculate?

Straight-line Euclidean distance between two points in a two-dimensional coordinate plane. Coordinates share one unit; selecting a unit labels the inputs and result without converting coordinates.

Can I enter identical points?

This page reuses the shipped line engine, which requires distinct points and rejects identical coordinates. Mathematically coincident points have zero distance, but they are outside this engine’s accepted inputs.

Does a vertical line have a distance?

Yes. The distance is the absolute difference between the y coordinates. Slope and y-intercept are undefined for a vertical line, but distance and midpoint remain available.