Math calculator

Free distance calculator

Find the distance between two points on a coordinate plane — enter (x₁, y₁) and (x₂, y₂) and see the exact distance, updated live, as you type.

InputsLive
Point 1 — x₁
Point 1 — y₁
Point 2 — x₂
Point 2 — y₂
Enter the (x, y) coordinates of two points.
Result
Distance
5
(0, 0) → (3, 4) = 5
Δx3
Δy4
Midpoint(1.5, 2)
Distance5

d = √((x₂−x₁)² + (y₂−y₁)²). Standard 2D Euclidean distance.

Results are estimates. Consult a professional.

How it's calculated

How the distance calculator works

Distance in a coordinate plane is found using the Pythagorean theorem. The straight-line gap between two points is the hypotenuse of a right triangle whose legs are the horizontal and vertical separations.

2D distance: d = √((x₂ x₁)² + (y₂ y₁)²)
3D distance: d = √((x₂ x₁)² + (y₂ y₁)² + (z₂ z₁)²)
Speed-time: d = speed × time

The formula works in any consistent unit — metres, kilometres, miles, feet. The result is in the same unit as the coordinates. For travel distance, use d = speed × time and ensure the units match (km/h × hours = km).

Weisstein, Eric W. — Distance. MathWorld, Wolfram Research.
Example

Worked example: distance between two coordinate points

Example: points (2, 3) and (6, 7)

Find the straight-line distance between A = (2, 3) and B = (6, 7).

Δx = 6 2 = 4
Δy = 7 3 = 4
d = √(4² + 4²) = √(16 + 16) = √32 ≈ 5.657 units
d ≈ 5.66 units
The two points are about 5.66 units apart — the same as 4√2, the diagonal of a 4×4 square.
Quick reference

Distance formula results for integer coordinate pairs

Common coordinate pairs and their exact distances. The starting point is always the origin (0, 0) for simplicity.

Point APoint BDistance (exact)Distance (≈)
(0, 0)(3, 4)55.000
(0, 0)(5, 12)1313.000
(1, 1)(4, 5)55.000
(2, 3)(6, 7)4√25.657
(0, 0)(8, 6)1010.000
(1, 2)(7, 10)1010.000
(3, 3)(6, 7)55.000
(0, 0)(1, 1)√21.414

Distances computed using d = √((x₂−x₁)² + (y₂−y₁)²). Integer results are Pythagorean triples.

Practical tips

Tips for distance calculations

Whether you are working with coordinates, maps, or travel times, these tips help you get an accurate result.

  • Use consistent units — mixing metres for x and kilometres for y gives a meaningless result; convert all coordinates to the same unit before calculating.
  • The order of subtraction does not matter — (x₂−x₁)² equals (x₁−x₂)² because both are squared; distance is always positive.
  • Pythagorean triples give exact integer answers — pairs like (3,4,5), (5,12,13), and (8,15,17) are worth memorising for quick mental checks.
  • For map distances, use the Haversine formula — the Euclidean formula assumes a flat plane; for geographic coordinates (lat/lon) over long distances, Earth's curvature requires the Haversine or Vincenty formula.
  • Speed × time for travel distance — if you know rate and time, d = r × t is simpler than coordinates; ensure units match (km/h × h, or mph × h).
Accuracy & limits

Accuracy and limitations

This calculator uses the Euclidean distance formula, which gives exact straight-line (as-the-crow-flies) distance on a flat plane. It is not suitable for geographic distances over large areas where Earth's curvature matters. For driving or walking routes, actual travel distance is always longer than the straight-line result. Calculations use double-precision floating-point arithmetic (≈15 significant digits of accuracy).

Glossary

Key terms

The straight-line distance between two points in a flat (Euclidean) coordinate space.
An ordered pair (x, y) — or triple (x, y, z) in 3D — that locates a point in space.
Delta-x and delta-y: the horizontal and vertical differences between two points.
Three positive integers (a, b, c) satisfying a² + b² = c², giving integer distances.
The longest side of a right triangle; equals the straight-line distance between two coordinate points.
A trigonometric formula for great-circle distance on a sphere, used for geographic (lat/lon) coordinates.
About

About this calculator

Part of our math calculators suite — explore all calculators.

Questions

Frequently asked questions about the free distance calculator

A distance calculator is a free online tool that helps you find the straight-line distance between two points (x₁, y₁) and (x₂, y₂) in 2D space. The distance formula is the Pythagorean theorem applied to the difference vector. Δx and Δy form the legs of a right triangle; the distance is the hypotenuse. It runs entirely in your browser with instant results and no sign-up.
No. (x₂ − x₁)² and (x₁ − x₂)² are equal, so the distance is symmetric — the same regardless of which point you call A and which B.
The formula generalizes: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²). This calculator handles 2D only; for 3D distance, use the formula manually with a calculator that handles three coordinate pairs.
Euclidean (this calc) is the straight-line distance — the shortest path. Manhattan distance is |Δx| + |Δy| — the path you'd walk on a grid of city blocks. They're equal only when the two points are on the same horizontal or vertical line.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.