Distance Calculator

Whether you're figuring out how far apart two cities are, working through a geometry problem, or trying to plot points in 3D space, the right distance calculator makes the job straightforward. This tool covers all of it: flat 2D coordinates, three-dimensional space, and real-world geographic distances between locations on Earth. Pick the calculator that fits your situation, plug in your numbers, and get an accurate result fast. The sections below explain how each one works and what's going on under the hood mathematically.

Enter Details

Point 1 (x, y)

Point 2 (x, y)

Result

√((x₂−x₁)² + (y₂−y₁)²)

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Use the Distance Calculator

Using any of the calculators on this page follows the same basic pattern. Enter the coordinates or location data for your two points, then hit calculate. The result appears instantly, usually with the formula shown so you can see exactly how the number was reached.

A few things to keep in mind before you start:

  • Match your coordinate system. If you're working in a standard x-y plane, use the 2D calculator. For x-y-z space, use the 3D version. For real-world addresses or map coordinates, use the geographic distance tool.
  • Check your units. Coordinate-based calculators work in whatever unit your coordinates represent. Geographic calculators typically output miles or kilometers, and you can usually switch between them.
  • Negative values are fine. Coordinates can absolutely be negative; just enter the minus sign and the calculator handles it correctly.

That's really all there is to it. The math runs automatically, so you don't need to remember any formulas yourself.

Distance Between Two Points Calculator

This is the general-purpose option. Give it two points and it returns the straight-line distance between them, also called the Euclidean distance. It works for both 2D and 3D inputs depending on how many coordinate values you enter.

Straight-line distance assumes a perfectly direct path between the two points, with no obstacles, curves, or terrain in the way. That makes it ideal for geometry, physics problems, engineering layouts, and any situation where you're working in an abstract coordinate space rather than on an actual map.

If your use case involves real travel distances on Earth's surface, scroll down to the geographic distance section instead. The curvature of the planet means straight-line math doesn't quite apply there.

2D Distance Calculator

The 2D distance calculator finds the length of a straight line segment between two points on a flat plane. You provide two coordinate pairs, (x₁, y₁) and (x₂, y₂), and the calculator applies the standard distance formula to give you the result.

This is one of the most commonly used tools in basic geometry, and it comes up constantly in fields like architecture, graphic design, game development, and data visualization. Any time you're working with a flat grid or coordinate system, this is your go-to.

Distance Formula in a Coordinate Plane

The distance formula for two points in a coordinate plane comes directly from the Pythagorean theorem. If you draw a right triangle with the two points as opposite corners, the distance between them is the length of the hypotenuse.

The formula looks like this:

d = √((x₂ - x₁)² + (y₂ - y₁)²)

You subtract one x-coordinate from the other, square the result, do the same for the y-coordinates, add those two squared values together, and take the square root. The order you subtract doesn't matter since you're squaring the difference anyway, so (x₂ - x₁) gives you the same final answer as (x₁ - x₂).

For example, the distance between (1, 2) and (4, 6) works out to √((4-1)² + (6-2)²) = √(9 + 16) = √25 = 5.

Calculate Distance Between Cartesian Coordinates

Cartesian coordinates are just the standard x-y system you learned in school, where every point is defined by its horizontal position (x) and vertical position (y). Calculating the distance between two Cartesian coordinates is exactly what the formula above does.

A couple of practical notes when working with Cartesian coordinates:

  • The scale of your axes matters. If one unit on your grid represents one meter, your distance result is in meters. If one unit represents one pixel, you get pixels. The formula itself is unit-agnostic.
  • Points in any quadrant work fine. A point at (-5, -3) is treated exactly like a point at (5, 3); the signs carry through the math correctly.
  • Decimal coordinates are no problem. (2.5, 7.8) to (9.1, 3.3) works just as cleanly as whole numbers.

The 2D calculator handles all of this automatically, but knowing the mechanics helps you catch any input errors before they produce a weird result.

3D Distance Calculator

Add a third dimension and the distance formula extends naturally. Instead of just x and y, each point now has an x, y, and z coordinate. The calculator takes all six values and returns the straight-line distance through three-dimensional space.

3D distance calculations are common in fields like computer graphics, robotics, structural engineering, and scientific modeling. Any time you're working in a space that has depth as well as width and height, you need the 3D version.

The concept is the same as 2D: you're still finding the length of the straight-line segment between two points. The extra dimension just adds one more squared difference under the square root sign.

Distance Formula for 3D Coordinates

The 3D distance formula is a straightforward extension of the 2D version:

d = √((x₂ - x₁)² + (y₂ - y₁)² + (z₂ - z₁)²)

You're doing the same operation three times instead of two: subtract, square, and add to the running total. Then take the square root of the sum.

As a quick example, the distance between point A at (1, 2, 3) and point B at (4, 6, 3) would be √((4-1)² + (6-2)² + (3-3)²) = √(9 + 16 + 0) = √25 = 5. Notice that when the z-coordinates are the same, the z term drops out and you're effectively back to a 2D calculation in the horizontal plane.

For points that differ on all three axes, say (0, 0, 0) to (1, 1, 1), the distance is √(1 + 1 + 1) = √3, which is roughly 1.732. That's the length of the main diagonal of a unit cube, which is a nice way to sanity-check the formula.

Distance Between Two Locations

Calculating the distance between two real-world locations is a different problem than working with abstract coordinates. Earth is a sphere (technically an oblate spheroid), so distances on its surface follow curves rather than straight lines. You can't just plug latitude and longitude into the 2D formula and expect an accurate answer.

Geographic distance tools account for Earth's shape. They take coordinates expressed in degrees of latitude and longitude and calculate how far apart the two locations actually are along the surface of the planet. The result is useful for travel planning, logistics, navigation, mapping applications, and anywhere else you need to know how far apart two places on a globe really are.

Latitude and Longitude Distance Calculator

Latitude and longitude give every point on Earth a unique address. Latitude measures how far north or south a point is from the equator (ranging from -90° at the South Pole to +90° at the North Pole). Longitude measures east-west position from the Prime Meridian (ranging from -180° to +180°).

To use a latitude/longitude distance calculator, you enter the coordinates of both locations. These might look like 40.7128° N, 74.0060° W for New York City, or you might enter them as decimal degrees (40.7128, -74.0060) depending on the tool.

The calculator then applies a spherical geometry formula to determine the surface distance. Most tools let you choose between miles and kilometers for the output. For most everyday purposes, this gives you a very accurate result. For extremely precise scientific or engineering work, a more advanced geodetic model may be warranted.

Great Circle Distance Calculator

A great circle is the largest circle you can draw on a sphere, and it always passes through the center of that sphere. The path a great circle traces on the surface is the shortest possible route between two points on a sphere. That's why long-haul flights often look curved on a flat map: they're actually following a great circle route, which is the most efficient path.

The great circle distance between two points is calculated using the Haversine formula (or in some cases the Vincenty formula for higher precision). The Haversine formula takes the latitude and longitude of both points in radians and returns the central angle between them. Multiply that angle by Earth's radius (about 3,958.8 miles or 6,371 km) and you get the surface distance.

For short distances, the difference between a simple flat-Earth approximation and true great circle distance is small. For distances of hundreds or thousands of miles, it can be significant. The great circle calculator gives you the accurate version regardless of distance.

Map Distance Calculator

A map distance calculator lets you measure distances directly on a map interface rather than entering raw coordinates. You click on two (or more) points on the map, and the tool calculates the distance along the path you've defined. Some versions let you plot a multi-point route and sum up the total distance.

This kind of tool is useful when you know where things are geographically but don't have the coordinates memorized. You can locate a starting point, drop a pin, find your destination, and get a result without ever looking up a latitude or longitude number.

Keep in mind that map distance tools typically measure as-the-crow-flies distance between points unless they're specifically routing along roads or trails. If you need driving distance or walking distance, a routing tool (like a navigation app) is more appropriate since it accounts for actual roads, turns, and paths.

Distance Formula and Examples

Here's a quick reference for the distance formulas covered on this page, along with a worked example for each.

2D Distance Formula: d = √((x₂ - x₁)² + (y₂ - y₁)²)

Example: Points (3, 4) and (7, 1)
d = √((7-3)² + (1-4)²) = √(16 + 9) = √25 = 5

3D Distance Formula: d = √((x₂ - x₁)² + (y₂ - y₁)² + (z₂ - z₁)²)

Example: Points (0, 0, 0) and (2, 3, 6)
d = √(4 + 9 + 36) = √49 = 7

Haversine Formula (Great Circle Distance): Used for latitude/longitude pairs. The formula accounts for Earth's curvature and outputs surface distance in miles or kilometers.

Example: New York City (40.7128° N, 74.0060° W) to Los Angeles (34.0522° N, 118.2437° W)
Great circle distance ≈ 2,451 miles (3,944 km)

These formulas are built into the calculators above, but seeing the numbers worked out by hand is a solid way to verify your inputs and make sure the result makes sense.

Euclidean Distance vs Geodesic Distance

These two terms come up a lot in distance calculations, and the difference matters depending on what you're trying to measure.

FeatureEuclidean DistanceGeodesic Distance
Surface typeFlat plane or abstract coordinate spaceCurved surface (like Earth)
Path typeStraight line through spaceShortest path along a curved surface
FormulaPythagorean theorem extended to n dimensionsHaversine or Vincenty formula
Best forGeometry, physics, data science, engineeringGeographic locations, navigation, mapping
Accounts for Earth's shape?NoYes

Euclidean distance is the straight-line measurement between two points in flat space. It's what you get when you apply the standard distance formula to any set of coordinates. It's the right choice whenever your coordinate system is flat and abstract, not tied to the physical surface of a sphere.

Geodesic distance is the shortest path between two points along a curved surface. On Earth, that path follows a great circle. It's what you want when your points are actual places on the globe and you need to know how far apart they are in the real world.

Mixing them up leads to meaningless results. Using Euclidean distance on latitude/longitude coordinates produces a number that doesn't correspond to any real-world measurement. And using geodesic formulas on abstract x-y coordinates is unnecessary and adds complexity with no benefit. Match the method to the problem and you'll always get a useful answer.

Other Maths Calculators

Explore all