How to calculate distance between two points
Enter each point in the labelled tuple. For a coordinate grid, use one common length unit or choose unitless. For Earth, use decimal degrees or degrees, minutes and seconds such as 23° 30′ 0″ N.
Choose the kind of distance
In one dimension, subtract and take the absolute value. In two or three dimensions, square the coordinate differences, add and take the square root. On Earth, choose a surface model; its shortest path generally curves on a flat map.
Work through a coordinate example
For P₁ = (1, 2) and P₂ = (4, 6), the changes are 3 and 4. The distance is √(9+16) = 5 and the midpoint is (5/2, 4). Reversing the points flips the changes and keeps the distance and midpoint. Use coordinates from the same axes and one unit.
Enter latitude and longitude
Latitude goes from −90° to 90°, longitude from −180° to 180°. Negative latitude is south and negative longitude is west. In DMS, 23° 30′ 0″ S is −23.5°. Use N/S for latitude and E/W for longitude, or use a sign and no letter. Minutes and seconds must be less than 60.
Pick the Earth model
WGS 84 uses an equatorial radius of 6378137 m and inverse flattening 298.257223563. The sphere uses a fixed radius of 6371008.8 m. A quarter equator is about 10018.75 km on WGS 84 and 10007.56 km on the sphere. Neither estimates road mileage or altitude.
Read the map and azimuths
On the decimal-degree map, set or drag two points. The path can cross the date line and is drawn on both edges instead of through the map. The initial azimuth measures clockwise from north; arrival azimuth follows the continuing direction of that same path. Identical points have no direction, and an antipodal pair has no single direction reported. Other nearly antipodal pairs can also admit more than one shortest path.
Convert and keep the result
The international foot is 0.3048 m, the international mile is 1609.344 m, and the nautical mile is 1852 m. Coordinate results can retain an exact radical or fraction. Copy or download the labelled measurements and formula steps. The map is a low-detail overview, so use typed coordinates for precision.
Use the Slope Calculator when you need the rise, run or equation of a line through two points. The Root Calculator can simplify the square root in the distance formula and the Fraction Calculator can check exact coordinate differences. Use the Triangle Calculator for a triangle with measured sides, the Ratio Calculator to convert a map scale and the Area Calculator to calculate the area of the resulting plane shape. The Pythagorean Theorem Calculator shows the same square relationship for a right triangle and can check three measured sides.
OpenStax — Vectors in Three Dimensions derives the coordinate formula. NGA — World Geodetic System 1984 gives the WGS 84 ellipsoid parameters, and Karney — Geodesics on an Ellipsoid documents the inverse geodesic algorithm. NIST SP 811 — International Nautical Mile gives the nautical mile conversion; BIPM SI Brochure and ISO 80000-2:2019 cover units and notation.
Common questions
What is the distance from (1, 2) to (4, 6)?
It is 5 in the coordinate unit, because √[(4−1)²+(6−2)²] = 5.
How do I add a third coordinate?
Choose 3D and fill x, y and z for both points. The square of the z difference adds to the sum.
Are Earth results driving distances?
No. They are shortest surface distances on the selected model, without roads, elevation or obstacles.
Can I enter DMS coordinates?
Yes. Choose the degrees, minutes and seconds mode. For example, 30° 15′ 0″ W is −30.25° longitude.
Why do WGS 84 and sphere answers differ?
Earth is flattened in WGS 84. A sphere uses one constant radius, which produces slightly different distances.
What are significant digits?
They count from the first nonzero digit. At 3 significant digits, 123.456 rounds to 123. The setting changes the display, not the quality of the input.
Explore related tools
- Right Triangle Calculator
- Pythagorean Theorem Calculator
- Surface Area Calculator
- Circle Calculator
- Area Calculator
- Slope Calculator
- Volume Calculator
- Triangle Calculator
- Confidence Interval Calculator
- Z-score Calculator
- Permutation and Combination Calculator
- Mean, Median, Mode & Range Calculator
- Statistics Calculator
- Probability Calculator
- Sample Size Calculator
- Number Sequence Calculator
- Standard Deviation Calculator
- Random Number Generator
- Scientific Notation Calculator
- Big Number Calculator
- Root Calculator
- Log Calculator
- Matrix Calculator
- Rounding Calculator
- Exponent Calculator
- Fraction Calculator
- Scientific Calculator
- Percentage Calculator
- Percent Error Calculator
- Quadratic Formula Calculator
- Least Common Multiple Calculator
- Greatest Common Factor Calculator
- Factor Calculator
- Ratio Calculator