Precision Proximity Intelligence Engine

๐Ÿ“

Distance Calculator

2D, 3D, and geographic distance between two points. Haversine great-circle, interactive map.

๐Ÿ“

Points & mode

Location data is processed locally; no maps are tracked
Result
Distance5.0000 units
๐Ÿ“

Current calculation

d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ] = โˆš[(3-0)ยฒ + (4-0)ยฒ] = 5.0000

Using this calculator

Choose 2D or 3D for Cartesian coordinates (Euclidean distance), or Geographic for lat/lon (great-circle distance). For geo, use decimal degrees; drag map markers to set points. For definitions and coordinate systems, see the article below.

Formulas used

2D (Euclidean): d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ]

3D (Euclidean): d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ + (zโ‚‚โˆ’zโ‚)ยฒ]

Geographic (Haversine, great-circle): Earth radius R = 6,371 km. Distance in km: d = 2R ร— atan2(โˆša, โˆš(1โˆ’a)), where a = sinยฒ(ฮ”ฯ†/2) + cos ฯ†โ‚ cos ฯ†โ‚‚ sinยฒ(ฮ”ฮป/2) (angles in radians).

When and How to Use the Distance Calculator

Pick a mode from your data type; formulas and definitions are in the article below.

Workflow Tips

When You Have (x, y) or (x, y, z)

Choose 2D or 3D mode. The result uses the same units as your axes (e.g. meters, feet).

When You Have Two Places on Earth

Switch to Geographic mode. Enter coordinates in decimal or degree-minute-second (DMS), or drag the map markers; pick your output unit (km, miles, nautical miles, etc.).

Using the Map

Click the map to set Point 1, then Point 2 (alternating). Drag markers to fine-tune; coordinates update in both decimal and DMS.

Choosing Units

2D/3D: distance is in your coordinate units. Geographic: select display unit before or after entering points.

Distance Calculator: 2D, 3D & Great-Circle Distance

Free distance calculator: distance between two points, distance between two cities. 2D and 3D distance formula, latitude longitude distance, great circle distance. How to calculate distance between two points; air distance between cities; Euclidean and geodesic distance.

What This Calculator Does & Who It's For

Calculator Purpose & Ideal Users

  • What You'll Get:
    2D: Straight-line distance
    d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ]
    3D: Same with (zโ‚‚โˆ’zโ‚)ยฒ added under the square root. Geographic: Great-circle (air) distance in km, miles, or nautical miles. Map: In Geographic mode, an interactive map with draggable markers; coordinates stay in sync.
  • Ideal Users:
    Students & geometry: 2D/3D distance formula, coordinate systems. Travel & logistics: Air distance between cities, how far between two cities. Developers & GIS: Distance between two coordinates for apps or scripts. Anyone with two points: Cartesian or decimal degrees.
  • Scope & Limits:
    Geographic mode uses a spherical-Earth formula (R = 6,371 km). Lat ยฑ90ยฐ, lon ยฑ180ยฐ. Accepts decimal degrees or degree-minute-second (DMS). Location data is processed locally; no maps are tracked.
This tool computes the distance between two points in 2D, 3D, or on the Earth (latitude/longitude).

What Is a Distance Calculator? Distance Between Two Points and Two Cities

A distance calculator (or distance between two points calculator) finds the distance between two points or the distance between two cities. In 2D or 3D it uses the Euclidean distance (Pythagorean theorem)โ€”the straight line distance between two points. For latitude longitude it uses the great circle distance formula (Haversine) for air distance between cities. Use it for the 3D distance formula, distance between two coordinates, or to measure distance on a map. How to calculate distance between two points: enter coordinates (decimal or degree-minute-second) or use the map; result in km, miles, or nautical miles. Free online; all calculations local.

Euclidean vs. Geodesic Distance: Straight Line vs. Great Circle

Euclidean distance is the straight line distance between two points in flat space:
d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ]
in 2D, plus
(zโ‚‚โˆ’zโ‚)ยฒ
in 3D. Geodesic distance is the shortest path along the Earthโ€™s surfaceโ€”a curve on a flat map, or great circle distance. For distance between two lat long points, this calculator uses the Haversine formula to compute that arc in km. Driving distance and road routes require a routing service; this tool gives air miles between cities (great-circle) only.

Coordinate Systems: Cartesian (X,Y,Z) vs. Latitude Longitude

Cartesian (X, Y, Z): Right-handed axes; result in the same units as your coordinates (meters, feet, etc.). Latitude longitude (decimal degrees): latitude ยฑ90ยฐ (N/S), longitude ยฑ180ยฐ (E/W). Earth distance uses a spherical model:
R = 6,371 km
Great-circle (Haversine) distance in km:
d = 2R ร— atan2(โˆša, โˆš(1โˆ’a))
where
a = sinยฒ(ฮ”ฯ†/2) + cos ฯ†โ‚ cos ฯ†โ‚‚ sinยฒ(ฮ”ฮป/2)
(angles in radians). Enter decimal degrees in Geographic mode or use the map to set points; the tool shows latitude longitude distance in your chosen unit.

How to Calculate Air Distance Between Two Cities

To find the shortest distance between two cities (as the crow flies): get the latitude and longitude of both cities (decimal or degree-minute-second), enter them in Geographic mode, or use the map to place markers. The calculator returns the great circle distanceโ€”the shortest path over the Earthโ€™s surfaceโ€”in km, miles, or nautical miles. Thatโ€™s the same as air distance between cities that flights follow. For driving distance or how far is it between two cities by road, use a routing or maps service; this tool gives straight-line (air) distance only.

Distance Calculator FAQ

? What is the 3D distance formula?

The 3D distance formula is the Euclidean distance between two points (xโ‚, yโ‚, zโ‚) and (xโ‚‚, yโ‚‚, zโ‚‚):
d = โˆš[(xโ‚‚โˆ’xโ‚)ยฒ + (yโ‚‚โˆ’yโ‚)ยฒ + (zโ‚‚โˆ’zโ‚)ยฒ]
It extends the 2D Pythagorean theorem by adding the z-difference. This distance calculator supports 2D, 3D, and geographic (lat/lon) modes.

? How do I find distance on a map?

For distance on a map between two places, use latitude and longitude (decimal degrees). Enter the coordinates of both points, or use the interactive map to click or drag markers. The calculator uses the Haversine formula to compute the great-circle (air) distance. You can display the result in km, miles, or nautical miles.

? Is the Earth a perfect sphere for these calculations?

The Haversine formula assumes a spherical Earth with radius 6,371 km, which is a good approximation for most purposes. For higher precision over long distances, the Vincenty formula uses an ellipsoid (WGS84); the difference is usually under 0.5%. This calculator uses Haversine for clarity and speed; for sub-meter accuracy over thousands of km, use a geodesic library.

? What is the difference between Euclidean and geodesic distance?

Euclidean distance is the straight-line distance in flat (Cartesian) spaceโ€”what you get with the 2D or 3D formula. Geodesic distance (great-circle distance) is the shortest path along the Earthโ€™s surface between two pointsโ€”an arc, not a straight line through the globe. For lat/lon, this calculator uses Haversine to compute geodesic distance in km.

? How do I get latitude and longitude for a city?

Search for โ€œlatitude longitude [city name]โ€ or use a site like OpenStreetMap. Enter coordinates in decimal degrees (e.g. 40.7128, -74.0060 for New York). This calculator also has an interactive map: switch to Geographic mode and drag the markers to set points; the lat/lon fields update automatically.
๐Ÿ’ก
Mathematical Reference Note

Calculation Logic: This tool uses standard mathematical algorithms. While we strive for accuracy, errors in logic or user input can result in incorrect data.

Verification: Results should be cross-checked if used for important academic, professional, or personal calculations.

Standard Terms: This tool is provided free of charge and as-is. CalcRegistry provides no warranty regarding the accuracy or fitness of these results for your specific needs.

ยฉ 2026 CalcRegistry Reference Last System Check: FEB 2026Free Online Utility Tools