"Coordinate length" sounds like jargon, but the question underneath it is the oldest one in geometry: two points, how far apart? On a coordinate plane the answer is the distance formula, and the formula is not a new invention to memorize; it is the Pythagorean theorem applied to the gaps between the points. Subtract the x values to get the horizontal gap, subtract the y values to get the vertical gap, and those two gaps are the legs of a right triangle whose hypotenuse is the distance you want. This guide builds the method from that picture, works it on pairs chosen so the arithmetic stays honest, extends it into three dimensions, and then marks the exact boundary where the flat plane stops being the right model, because coordinates on the Earth curve, and past a certain scale a different formula owns the question. The tool below runs that Earth scale version: click two real places and it measures them the way the end of this article explains.
Home / Coordinates and Location Formats
How to Find the Length Between Coordinates: The Distance Formula, in 2D, 3D, and on the Earth

Photo: Diana / Pexels
Distance Measurer: The Formula at Real World Scale
Click the two ends of any leg and read the distance. On the plane the distance formula does this with coordinate gaps; between real places the same idea runs on a sphere, which is why the numbers here come from the haversine instead.
Total straight-line distance, 0 points
Click the map to start
Distances are great-circle (haversine, mean Earth radius 6,371 km): the shortest path over the surface, not a road or trail distance. Map data © OpenStreetMap contributors.
The Formula, and Why It Is Pythagoras
For two points (x1, y1) and (x2, y2), the length between them is:
d = square root of ((x2 minus x1) squared + (y2 minus y1) squared)
Draw the two points and complete the right triangle: a horizontal line from the first point and a vertical line from the second meet at a corner, forming legs of length |x2 minus x1| and |y2 minus y1|. Pythagoras says the hypotenuse squared equals the sum of the leg squares, and the distance formula is that sentence with coordinates substituted. Two consequences are worth internalizing. First, order does not matter: subtracting in either direction gives the same gaps up to sign, and squaring erases the sign, so (x2 minus x1) and (x1 minus x2) are interchangeable. Second, the gaps are what matter, not the points: any two pairs with the same gaps have the same length, which is why the segment from (0, 0) to (3, 4) and the segment from (5, 3) to (8, 7) are both length 5.
Worked Example One: A Clean Ten
Take A(5, 3) and B(minus 3, minus 3), a pair whose answer is exact. The x gap: minus 3 minus 5 = minus 8, so the horizontal leg is 8. The y gap: minus 3 minus 3 = minus 6, so the vertical leg is 6. Square them: 64 and 36. Add: 100. Square root: 10. The segment AB has length exactly 10 units. Notice the 6, 8, 10 triangle hiding inside: it is the 3, 4, 5 triangle doubled, and recognizing these scaled triples is the fastest sanity check in this whole topic. If your gaps are 6 and 8 and your answer is not 10, the error is in the arithmetic, not the method. Notice also that the negative coordinates caused no difficulty at all: the subtraction handled the signs, and squaring removed them. Points in the third quadrant are not a special case.
Worked Example Two: When the Answer Is Not Clean
Take (minus 3, 5) and (4, minus 2). The x gap: 4 minus (minus 3) = 7. The y gap: minus 2 minus 5 = minus 7, a leg of 7. Squares: 49 and 49. Sum: 98. Square root: the square root of 98 is approximately 9.90. Most real pairs behave like this, ending in a decimal, and two habits keep the decimal honest. Keep the exact form, square root of 98, through any further algebra and round only at the end; and simplify when you can, since the square root of 98 is 7 times the square root of 2, a form some courses prefer. The double negative in the x gap, 4 minus (minus 3) = 7, is the single most common error site in this topic: subtracting a negative adds. Write the parentheses, every time, and the error loses its home.

The Special Case: Length From the Origin
Sometimes "coordinate length" means the length of one point's position: how far (x, y) sits from the origin (0, 0). That is the same formula with the second point set to zero, collapsing to d = square root of (x squared + y squared), which readers of vectors know as the magnitude. The point (3, 4) has length 5; the point (minus 6, 8) has length 10; the point (5, 12) has length 13. If a problem gives one point and asks for its length or magnitude, the origin is the silent second point. The direction companion, the angle of that same vector, is a different question with its own method, covered in our guide to coordinate direction angles of a vector; length and direction together are the full description of a point in polar form, which is the bridge to the polar conversions in how to find Cartesian coordinates.
Extending to 3D: One More Gap
Three dimensional coordinates add a z value, and the formula adds one more squared gap under the same root:
d = square root of ((x2 minus x1) squared + (y2 minus y1) squared + (z2 minus z1) squared)
The geometry is Pythagoras applied twice: first across the floor of the box the two points define, then up its vertical edge. Worked example: (1, 2, 3) to (4, 6, 15). Gaps: 3, 4, and 12. Squares: 9, 16, and 144. Sum: 169. Square root: 13, exactly. The 3, 4, 12, 13 combination is the 3D echo of the flat triples, worth recognizing on sight. Real uses are everywhere coordinates carry height: drone flight legs, game world positions, and the z coordinate work in our guide to how to calculate the z coordinate, where the vertical gap stops being an abstraction and becomes altitude.
The Error Clinic: Three Ways the Arithmetic Dies
Adding before squaring. The gaps 8 and 6 tempt the hurried into (8 + 6) squared, or worse, 8 + 6 = 14 as the answer. The formula squares each gap separately and adds the squares: 64 + 36 = 100. If your length comes out larger than the sum of the gaps, this error is the prime suspect; a hypotenuse is always shorter than the two legs walked together. Forgetting the root. 100 is the length squared, not the length; the square root is a step of the method, not a decoration. A length that exactly equals a suspiciously round sum of squares is usually the root left untaken. Mixing units mid problem. Gaps in centimeters against gaps in meters, or degrees treated as kilometers on the Earth, produce numbers that are arithmetically perfect and physically meaningless. Write the unit beside each gap before squaring anything; the formula cannot defend units you never declared.
Units, Grids, and the Honest Limits of the Plane
The formula returns a number in coordinate units, and what a unit means is your grid's business. On graph paper, units are squares. In a projected map system like UTM, coordinates are meters, so the formula returns meters directly, which is one reason projected systems exist; our GPS coordinates vs UTM comparison explains that trade. In a game or CAD world, units are whatever the world declares. The trap is mixing: gaps computed from one grid applied to another's scale. And the plane itself has a limit. The distance formula assumes a flat surface, and it is exactly right there. The Earth's surface is not flat, so for latitude and longitude pairs the formula in raw degrees produces a number in degrees, which is not a length at all until the curve is accounted for. Short legs forgive the approximation; city to city legs do not.
On the Earth: Where the Haversine Takes Over
For geographic coordinates, the length between two points is the great circle distance, computed by the haversine formula on a sphere: it converts the latitude and longitude gaps into an angle at the Earth's center and multiplies by the radius, 6,371.0088 km in the mean Earth model this site uses. New York (40.7128, minus 74.0060) to Boston (42.3601, minus 71.0589) measures 306.1 km by that method, the anchor leg the tool above reproduces when you click the two cities. The naive plane formula on the same pair gives about 2.54 degrees, a number with no units you can spend. Rule of thumb: within a small site, a campus, a survey plot, plane math on a projected grid is correct and standard; between places you would name on a map of a country, use the sphere. Our how to measure distance on a map guide covers the paper and screen versions of the same judgment, and coordinates between two points covers the reverse family of questions, finding points along the segment rather than its length.
Related Guides
The closest companions to this guide are the coordinates guides below. Each one picks up a thread this page starts:
- How to Find the Coordinates of a Midpoint: The Average, and When It Lies: The midpoint between two coordinates is usually just an average: add the latitudes and divide by two, add the longitudes and divide by two.
- How to Find Centroid Coordinates: Points, Triangles, Polygons, and Places on Earth: The centroid is the balance point of a shape or a set of points, and the method for finding it depends on what you have.
- How to Find the Coordinates of the Vertex of a Parabola: Three Methods: The vertex is the point where a parabola turns, and finding its coordinates is a three-line skill once the formula is understood rather than...
Frequently Asked Questions
What is the formula for the length between two coordinates?
d equals the square root of ((x2 minus x1) squared plus (y2 minus y1) squared). Subtract the coordinates to get the horizontal and vertical gaps, square both gaps, add the squares, and take the square root. It is the Pythagorean theorem applied to the gaps.
Does the order of the points matter?
No. Subtracting in either direction changes only the signs of the gaps, and squaring removes signs, so (x2 minus x1) and (x1 minus x2) give the same length. What matters is consistency inside a single subtraction: do not mix x from one order with y from the other when signs matter for direction, though for pure length even that washes out in the squares.
How do you find the length of a single coordinate from the origin?
Use d equals the square root of (x squared plus y squared), which is the distance formula with the second point at (0, 0). For example, (3, 4) has length 5 and (minus 6, 8) has length 10. This value is also called the magnitude of the position vector.
How does the formula change in 3D?
Add the squared z gap under the same square root: the gaps of (1, 2, 3) to (4, 6, 15) are 3, 4, and 12, whose squares sum to 169, giving a length of exactly 13. The method is Pythagoras applied twice, across the base and then up the height.
Can I use the distance formula on latitude and longitude?
Not directly. Latitude and longitude are angles on a sphere, so the plane formula returns degrees, not a length. For geographic pairs use the great circle (haversine) distance: New York to Boston is 306.1 km by that method. On a projected grid like UTM, whose coordinates are meters, the plane formula works and returns meters.
Photo credits: Diana (Pexels); thiago japyassu (Pexels). Photos are served from this site; follow the credit to the library page for the original.