Distance Calculator
This distance calculator finds the straight-line separation between two coordinate points in two or three dimensions. It subtracts matching coordinates and combines the differences using the Pythagorean theorem, reporting the answer in meters or feet.
By Dr. Hassan Khames EliwaLast updated
Result
- Change in x
- 3 m
- Change in y
- 4 m
How it works
Start with a shared coordinate system
Coordinates describe locations relative to an origin and a set of axes. Before entering a pair of survey marks, drawing points, or equipment positions, confirm that both records use the same origin, axis directions, and length unit. Moving the origin changes the coordinates but does not change the distance between the points.
For a flat plan, enter x1, y1, x2, and y2. The calculation is d = √((x2 − x1)² + (y2 − y1)²). Negative coordinates are perfectly acceptable: a point west of the chosen origin may have a negative x value. The differences, rather than the individual coordinate signs, determine separation.
Add elevation only when it belongs in the measurement
In three dimensions, the formula adds (z2 − z1)² beneath the square root. Use this setting when the straight connection rises or falls between the endpoints. The horizontal distance and the sloping distance answer different questions; neither replaces the other on a setting-out drawing.
The implementation uses a scaled hypotenuse calculation rather than directly summing large squares. That reduces avoidable numeric overflow, although extremely large coordinate differences can still exceed ordinary computer-number limits and are rejected. Results are displayed to at most six decimal places, not as a statement of measurement accuracy.
Understand what the unit selector does
Metric means every entered coordinate is in meters; imperial means every coordinate is in feet. Switching the selector changes the interpretation of the numbers, not their stored values. Convert an existing coordinate list before switching systems. Decimal feet are not feet-and-inches notation: six feet six inches must be entered as 6.5 feet.
This is Euclidean distance on a flat coordinate system. Latitude and longitude are angular coordinates and require a geographic distance method. A road journey, cable route around obstacles, or walking path may be substantially longer than the direct endpoint separation.
Worked example
Example 1: Checking a diagonal on a floor plan
A layout point is at (0, 0) meters and a second point is at (3, 4) meters. Select 2D and meters. The x change is 3 m and the y change is 4 m. Squaring and adding gives 9 + 16 = 25, whose square root is 5. The displayed distance is 5 m. This familiar diagonal is useful for checking that two perpendicular offsets were entered in the intended order.
Example 2: Measuring a rising connection
A connection starts at (0, 0, 0) feet and finishes at (3, 4, 12) feet. Select 3D and feet. The changes are 3 ft, 4 ft, and 12 ft. The horizontal component is 5 feet, but the full calculation is √(9 + 16 + 144) = 13. The displayed distance is 13 ft. This is the straight endpoint length, before adding bends, fittings, attachment allowances, or installation slack.
Expert tips
Common mistakes
- Mixing millimeters with meters produces a numerical answer with no useful physical meaning. Normalize every coordinate to the selected length unit before calculating.
- Entering an empty visible coordinate is not equivalent to entering zero. The calculator rejects missing values so an incomplete point cannot silently become a location on an axis.
- Treating displayed decimal places as instrument accuracy overstates the result. A distance computed from approximate tape measurements remains approximate even when several digits are shown.
Frequently asked questions
Can the two points be identical?
Yes. Identical points have zero separation, which is a valid distance. Negative distances never occur, although individual coordinate changes can be negative.
Does reversing the points change the answer?
The distance stays the same. Each coordinate change reverses sign, but squaring those changes removes the sign when calculating separation.
Are hidden elevation values used in 2D mode?
No. Only the four visible horizontal coordinates are required in 2D mode. Elevation fields are evaluated when you select three dimensions.
Can I use this for GPS coordinates?
Not directly. Longitude and latitude are angles on a curved Earth model. Convert to an appropriate projected coordinate system or use a geographic distance calculator.
How do I convert a distance afterward?
Use the unit converter for a separate conversion. Keep the original unit attached to your result so feet are not mistaken for meters during later calculations.
Related calculators
Related guides
MathPercentages people get wrong: change, difference and pointsThe denominator determines the answer. Learn to distinguish percentage change, symmetric difference and percentage-point movements.14 November 2026 · 7 min read
MathStandard deviation without the jargonThe average tells you the centre. Standard deviation helps describe the spread, provided you know what the data represents.14 November 2026 · 7 min readSources and standards
About the author
Dr. Hassan Khames Eliwa holds a PhD in Construction & Built Environment and has more than 20 years of international project controls experience. He is Director of Eliwa Project Controls Limited in Auckland and founder of PMMilestone.org and PMMilestone.com.
Buy me a coffee