Distance Calculator
Find the straight-line distance and midpoint between two points in 2D or 3D space.
Example
For points A(1, 2) and B(4, 6) in 2D:
Δx = 4 - 1 = 3
Δy = 6 - 2 = 4
distance = √(3² + 4²) = √25 = 5
midpoint = ((1+4)/2, (2+6)/2) = (2.5, 4)
How it works
Enter the coordinates of both points and pick 2D or 3D; the tool applies the Euclidean distance formula and reports the distance plus the midpoint. Results update as you type.
Good to know
This Distance Calculator finds the straight-line (Euclidean) distance between two points you define by coordinates, and it works in either a 2D plane (x, y) or 3D space (x, y, z). Alongside the distance, it returns the midpoint and the per-axis differences (Δx, Δy, and Δz in 3D), so you get the full geometric picture of the segment connecting point A and point B. It is built for students checking coordinate-geometry homework, anyone working with graphs or scatter plots, game and graphics developers placing objects, CAD and 3D-modeling users, and surveyors or engineers reasoning about points on a grid.
Reach for it whenever you have two sets of coordinates and need the as-the-crow-flies separation rather than a travel route. Common cases include verifying a Pythagorean-style answer, measuring the gap between two plotted data points, finding how far apart two vertices are in a model, or locating the exact center point between two positions. Because results update live as you type, it is also handy for quickly testing several point pairs without re-running anything.
To read the output: the large number is the distance in the same units as your inputs (if your coordinates are in meters, the distance is in meters). The midpoint is the coordinate exactly halfway along segment AB, and the delta values show how much each axis contributes; a large Δx with a small Δy means the points are spread mostly horizontally. Values are rounded to six decimal places for display, so very small residual digits are trimmed for readability.
- One practical caveat: this is geometric distance only. It does not account for roads, terrain, the curvature of the Earth, or any obstacle, so it is not a substitute for a map or GPS routing tool when you need real-world travel distance. For latitude/longitude points across large areas, a great-circle (haversine) calculation is more appropriate than this flat-plane formula.
Frequently asked questions
Does this measure straight-line distance or path distance?
It computes the Euclidean (straight-line) distance between the two points, not a route or path length. In 2D it uses √(Δx²+Δy²) and in 3D it adds Δz².
How is the midpoint calculated?
The midpoint is the average of each coordinate: ((Ax+Bx)/2, (Ay+By)/2) in 2D, with (Az+Bz)/2 added for 3D. It is the point exactly halfway along the line segment AB.
Is my data uploaded anywhere?
No — this calculator runs entirely in your browser; nothing is uploaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the formula for distance between two points?
In 2D the distance is the square root of (x2 minus x1) squared plus (y2 minus y1) squared. In 3D you add (z2 minus z1) squared inside the square root before taking the root.
How do I calculate distance between two points in 3D?
Take the differences along each axis (Δx, Δy, Δz), square each one, add them together, and take the square root of the sum. This tool does it automatically once you switch to 3D mode and enter the z-coordinates.
Does the order of the two points matter for the distance?
No. Because each axis difference is squared, swapping point A and point B gives the same distance and the same midpoint. Only the signs of the individual Δx, Δy, and Δz values would flip.
What units does the distance come out in?
The result is in whatever units your coordinates use, since the calculation is purely numeric. If you enter coordinates in feet, the distance is in feet; in pixels, it is in pixels.
Can I use this for latitude and longitude coordinates?
It will treat latitude and longitude as flat x and y values, which is only roughly accurate over very short distances. For geographic distances across larger areas, a great-circle or haversine calculation accounts for the Earth's curvature and is more accurate.
What is the difference between Euclidean distance and Manhattan distance?
Euclidean distance is the straight diagonal line between two points, which is what this tool computes. Manhattan distance is the sum of the absolute axis differences, as if you could only move along a grid, and is usually larger than the Euclidean value.
How do I find the midpoint between two coordinates?
Average each coordinate separately: add the two x-values and divide by two, do the same for y (and z in 3D). The result is the point lying exactly halfway along the line connecting them.
Can the distance ever be negative?
No. Distance is always zero or positive because the axis differences are squared before the square root is taken. A distance of zero means both points share identical coordinates.
Related calculators