Distance Calculator

Use this free online distance calculator to find the straight-line distance between two points on a coordinate plane. Enter the x and y coordinates of both points and get the exact Euclidean distance instantly.


How to Use the Distance Calculator

  1. Enter the coordinates of the first point in the "x1" and "y1" fields.
  2. Enter the coordinates of the second point in the "x2" and "y2" fields.
  3. Click "Calculate" to compute the distance.
  4. View the result in the "Distance" box below the button.

Why the Formula Works

Draw a horizontal line from the first point and a vertical line from the second. They meet at a right angle and form a right triangle whose hypotenuse is the straight line between your two points. The horizontal side is the change in x and the vertical side is the change in y, so the Pythagorean theorem gives the length of the hypotenuse.

Because both differences are squared, it does not matter which point you call the first one, and negative coordinates cause no trouble. The calculator returns the result rounded to three decimal places.

Step-by-Step Example with Negative Coordinates

Find the distance between A(−3, 2) and B(5, −4).

  1. Change in x: 5 − (−3) = 8.
  2. Change in y: −4 − 2 = −6.
  3. Square and add: 8 × 8 + (−6) × (−6) = 64 + 36 = 100.
  4. Square root: √100 = 10.

A frequent slip is subtracting a negative number wrongly: 5 − (−3) is 8, not 2. When the differences are not a neat pair, the answer is usually irrational; for (2, 1) and (7, 3) the calculator gives √29 ≈ 5.385.

MeasureFormulaFor A(−3, 2), B(5, −4)
Straight-line distance√(Δx² + Δy²)10
Midpoint((x1 + x2) ÷ 2, (y1 + y2) ÷ 2)(1, −1)
Grid (Manhattan) distance|Δx| + |Δy|14
Slope of ABΔy ÷ Δx−0.75

Grid distance is what you would walk along streets laid out in blocks, and it is always at least as long as the straight-line distance.

Where This Calculator Applies

  • Coordinate geometry problems in school mathematics, such as checking whether three points form an isosceles triangle by comparing side lengths.
  • Measurements on a flat plan or drawing, where both coordinates use the same unit and scale. Multiply the answer by the drawing scale to get real-world length.
  • It is not suitable for latitude and longitude. Degrees are not equal-length units on the curved Earth, so the distance between two cities needs a great-circle method such as the haversine formula.
  • It works only in two dimensions. For 3D points, add the squared change in z under the square root.

Frequently Asked Questions

It uses the Euclidean distance formula derived from the Pythagorean theorem: distance = √((x2 - x1)² + (y2 - y1)²).

Yes, all four coordinate fields (x1, y1, x2, y2) accept negative numbers and decimals.

For points (1, 2) and (4, 6), the distance is √((4-1)² + (6-2)²) = √(9 + 16) = √25 = 5.

Not accurately. This tool treats the inputs as points on a flat grid, but latitude and longitude are angles on a curved surface, and a degree of longitude gets shorter as you move away from the equator. Use a map service or a great-circle (haversine) calculation instead.

Extend the same formula with a third term: distance = √((x2 − x1)² + (y2 − y1)² + (z2 − z1)²). For (1, 2, 3) and (3, 5, 9), that is √(4 + 9 + 36) = 7. This calculator handles only the two-dimensional case.
No ratings yet — be the first!
Rate this calculator:
Was this tool helpful?