Distance Between Points Calculator

Measuring Straight-Line Distance

The distance between two points is simply the Pythagorean theorem in disguise: treat the horizontal and vertical gaps between the points as the two legs of a right triangle, and the straight-line distance is the hypotenuse. It works identically whether the points sit on a map, a graph, or a blueprint.

The Formula

d = √((x2 − x1)² + (y2 − y1)²)

The differences (x2−x1) and (y2−y1) are squared — which cancels the sign, so it never matters which point is labeled first — summed, and then square-rooted to get the direct-line distance.

Worked Example

For the points (1, 2) and (4, 6):

Distance calculation, step by step
StepCalculationResult
Δx4 − 13
Δy6 − 24
Sum of squares3² + 4²25
Distance√255

This example is the well-known 3-4-5 right triangle, which is why the distance comes out to a clean whole number.

Where This Matters

  • GPS and mapping — approximating straight-line distance between two coordinates on a local, flat projection.
  • Computer graphics and game development — checking how close two objects are, for collision detection or proximity triggers.
  • Statistics and machine learning — Euclidean distance between data points underlies clustering algorithms like k-means and nearest-neighbor search.
  • Construction layout — verifying diagonal measurements between two marked points on a site plan.

How to Use This Calculator

  1. Enter the coordinates of the first point, X1 and Y1.
  2. Enter the coordinates of the second point, X2 and Y2.
  3. Select Calculate to get the straight-line distance between the two points.

Related Calculations

Once you have two points, find the line connecting them with the Line Equation Calculator, or use three points to find enclosed area with the Triangle Area Calculator.