Distance Between Two Points Calculator - Euclidean Formula and Steps

Use this distance between two points calculator to return the Euclidean distance, midpoint, and slope for any two coordinates on the coordinate plane.

Updated: June 18, 2026 • Free Tool

Distance Between Two Points Calculator

x-coordinate of the first point on the plane.

y-coordinate of the first point on the plane.

x-coordinate of the second point on the plane.

y-coordinate of the second point on the plane.

Results

Distance (d)
0units
Δx (x2 − x1) 0units
Δy (y2 − y1) 0units
Squared distance (d²) 0units²
Midpoint x 0units
Midpoint y 0units
Slope (Δy / Δx) 0

What Is a Distance Between Two Points Calculator?

A distance between two points calculator takes the coordinates of two points on a Cartesian plane, applies the Euclidean distance formula, and returns the straight-line separation. Type (x1, y1) and (x2, y2), and the page returns the distance, midpoint, slope, and squared distance under the square root, so the arithmetic stays transparent.

  • Math homework: Confirm the distance, midpoint, or slope through two points, including Pythagorean triples.
  • Coordinate geometry: Plot two points, then read the distance, midpoint, and signed Δx / Δy values.
  • Mapping and screens: Measure the pixel or grid length between two on-screen locations.
  • Physics and engineering: Compute the magnitude of a 2D displacement vector from start and end coordinates.

Because the result comes from the Pythagorean theorem, the same distance between two points calculator handles integer, decimal, and negative coordinates without any special case beyond the natural formula.

When the answer is in generic units and you want meters, feet, miles, or pixels, Distance Converter changes the unit of the result without recomputing the geometry.

How the Calculator Works

The page implements the standard Euclidean distance formula in two dimensions. It takes the four coordinate inputs, builds the horizontal and vertical differences, squares and sums them, and takes the square root.

d = sqrt((x2 - x1)^2 + (y2 - y1)^2)
  • x1, y1: Coordinates of the first point.
  • x2, y2: Coordinates of the second point.
  • Δx = x2 − x1: Signed horizontal change between the two points.
  • Δy = y2 − y1: Signed vertical change between the two points.
  • d = sqrt(Δx² + Δy²): Euclidean distance; always non-negative.

The formula works for negative and decimal coordinates. Squaring removes the sign of Δx and Δy, so the distance is always non-negative no matter which point you call first.

Worked example: the 3-4-5 right triangle

Point 1: (0, 0). Point 2: (3, 4).

Δx = 3 − 0 = 3. Δy = 4 − 0 = 4. d = sqrt(3² + 4²) = sqrt(9 + 16) = sqrt(25).

d = 5 units

The two points form a 3-4-5 right triangle with the axes, and the length comes out to a clean integer because (3, 4, 5) is a Pythagorean triple.

Worked example: the 5-12-13 triple with negative coordinates

Point 1: (−2, −3). Point 2: (3, 9).

Δx = 3 − (−2) = 5. Δy = 9 − (−3) = 12. d = sqrt(5² + 12²) = sqrt(25 + 144) = sqrt(169).

d = 13 units

Squaring the differences absorbs the sign of the negative coordinates, and the distance stays positive even when one or both points lie in a negative quadrant.

According to Khan Academy, the distance between two points (x1, y1) and (x2, y2) on a coordinate plane is computed as the square root of (x2 - x1)^2 + (y2 - y1)^2, which is the Pythagorean theorem applied to the right triangle formed by the two points.

The same arithmetic is what generalizes to higher dimensions, so Euclidean Distance Calculator runs the L2 norm on a single coordinate list instead of two coordinates per point.

Key Concepts Behind the Distance Formula

Four ideas explain why this distance between two points calculator returns what it does.

Pythagorean theorem

Drop a horizontal and a vertical line from the two points to form a right triangle. The two legs are Δx and Δy, and the hypotenuse is d. The formula is just a² + b² = c² solved for the hypotenuse.

Euclidean distance

It is the length of the shortest path between the two points: a straight line. Squared differences are added before the square root, so the distance is non-negative and follows the triangle inequality.

Squared distance

The value under the square root, Δx² + Δy², is the squared distance. Many machine-learning and clustering tools work with d² to skip the square root and keep the arithmetic fast.

Midpoint and slope

The midpoint is the average of the two coordinates in each direction, and the slope is Δy over Δx. Together with the distance they fully describe the line segment that connects the two points.

These four concepts are the building blocks of the rest of analytic geometry. With the distance, midpoint, and slope in hand, you can reconstruct the line through two points in almost any form a textbook will ask for.

If you want to spot every pair of integer coordinates whose distance between two points comes out to an integer hypotenuse, Pythagorean Triples Calculator does that directly without typing in coordinates one at a time.

How to Use This Calculator

Five short steps cover every common case, from a clean textbook example to negative coordinates and a vertical segment where the slope is undefined.

  1. 1 Enter x1 and y1: Type the coordinates of the first point. The default is (0, 0); change both values if your point is elsewhere.
  2. 2 Enter x2 and y2: Type the coordinates of the second point. The default is (3, 4) so the example starts as the classic 3-4-5 right triangle.
  3. 3 Read the distance: The primary output is the Euclidean distance d, updated as you type. It is the same number whether you swap the two points or not.
  4. 4 Check the supporting values: Look at Δx, Δy, the squared distance, and the midpoint to confirm the arithmetic. The slope shows as a number, or as the word 'undefined' for vertical lines.
  5. 5 Reset or change units: Click Reset to return to the example, or open the Distance Converter to switch the result to meters, feet, or pixels.

Try the points (−2, −3) and (3, 9). The calculator returns Δx = 5, Δy = 12, d = 13, midpoint (0.5, 3), and slope 12 / 5. The result 13 confirms that (5, 12, 13) is another Pythagorean triple.

Once you have the distance and slope, Right Triangle Calculator can fill in the missing leg, hypotenuse, or angle.

Benefits of Using This Calculator

These benefits matter most when you are working a problem by hand and need a quick, trustworthy check.

  • Skip the arithmetic mistakes: Manual distance problems are easy to get wrong on the squaring step.
  • See the step-by-step math: The page shows Δx, Δy, the squared distance, and the final d.
  • Midpoint and slope for free: The calculator returns all three from the same four inputs.
  • Any sign of coordinate: Negative, decimal, and far-from-origin points all use the same formula.
  • Connect to analytic geometry: The page links out to peer calculators for the next step.

If you want to plot the two points and the line through them on a labeled grid, Coordinate Plane Calculator draws the picture that the numbers describe.

Factors That Affect the Result

The formula is the same in every case, but a few factors change how the result should be read.

Order of the two points

Swapping (x1, y1) and (x2, y2) flips the sign of both Δx and Δy, so the squared values, distance, midpoint, and slope are unchanged.

Coordinate scale and unit

The result is in the same unit as the coordinates. Use the Distance Converter to switch to meters, feet, or pixels.

Numerical precision of the inputs

Small rounding in the coordinates can shift the fourth decimal place of d. Enter coordinates with as much precision as the original problem gives.

Vertical line edge case (Δx = 0)

When x1 and x2 are equal, the slope is undefined and the distance is just |Δy|.

Sign of the coordinates

Negative coordinates work the same as positive because the formula squares Δx and Δy before adding.

  • This page is the planar, 2D case only. For 3D points (x, y, z), the formula needs an extra z term; the 3D vector magnitude page handles that directly.
  • The calculator assumes a flat Euclidean plane. It does not account for great-circle distance on a sphere or Manhattan distance along a road network, which use different formulas.
  • The result is the straight-line distance, not the path length. If the points lie on a curve, the straight-line distance is a lower bound on the path length, not the path length itself.

According to Wolfram MathWorld, the Euclidean distance between two points in two-dimensional space is given by d = sqrt((x2 - x1)^2 + (y2 - y1)^2), which generalizes the Pythagorean theorem to coordinate points.

According to Britannica, analytic geometry represents points as ordered coordinate pairs and uses the distance formula to compute the straight-line separation between any two such points on the plane.

When the two points sit on a city grid where travel follows the axes, Manhattan Distance Calculator computes |Δx| + |Δy| instead of the straight-line Euclidean distance.

Distance between two points calculator showing two coordinates on a plane, the Euclidean distance formula, and the step-by-step result
Distance between two points calculator showing two coordinates on a plane, the Euclidean distance formula, and the step-by-step result

Frequently Asked Questions

Q: What is the formula for the distance between two points?

A: The formula is d = sqrt((x2 - x1)^2 + (y2 - y1)^2). Subtract the x-coordinates, square the result, do the same with the y-coordinates, add the two squares, and take the square root of the sum.

Q: How do I calculate the distance between two points on a coordinate plane?

A: Enter the coordinates of the first point as x1 and y1, then the coordinates of the second point as x2 and y2. The calculator returns the Euclidean distance, the horizontal and vertical differences, the squared distance, the midpoint, and the slope in one pass.

Q: Can the distance between two points ever be negative?

A: No. The distance is a length, so it is always non-negative. Squaring the differences makes the under-the-root value non-negative, and the principal square root is non-negative too.

Q: What happens if both points are the same in this calculator?

A: If x1 equals x2 and y1 equals y2, both Δx and Δy are zero, the squared distance is zero, and the distance is exactly 0. The midpoint equals the original point and the slope is reported as undefined.

Q: How is this different from the 3D distance formula?

A: The 3D distance formula has the same first two terms plus a (z2 - z1)^2 term inside the square root. This page handles the 2D case where each point has only an x and a y coordinate.

Q: What is the midpoint of the segment between two points?

A: The midpoint is ((x1 + x2) / 2, (y1 + y2) / 2). It is the average of the two coordinates in each direction and lies exactly halfway along the line segment that connects the two points.