Distance, midpoint & circles
Distance Calculator
Calculate the straight-line distance between two points in 2D or 3D, or find the geographic distance between two locations using latitude and longitude. Uses the Haversine formula for great-circle (as-the-crow-flies) distance. Results in kilometers, miles, or nautical miles.
Points & mode
Current calculation
d = √[(x₂−x₁)² + (y₂−y₁)²] = √[(3-0)² + (4-0)²] = 5
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; the map draws the great-circle arc between the two points on a Mercator basemap. Drag markers or click 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 Two Places on Earth
Using the Map
Choosing Units
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.
How to Use This Calculator
What This Calculator Does & Who It's For
Calculator Purpose & Ideal Users
- What You'll Get:2D: Straight-line distanced = √[(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.
What Is a Distance Calculator? Distance Between Two Points and Two Cities
Euclidean vs. Geodesic Distance: Straight Line vs. Great Circle
Coordinate Systems: Cartesian (X,Y,Z) vs. Latitude Longitude
How to Calculate Air Distance Between Two Cities
Distance Calculator FAQ
What is the 3D distance formula?
How do I find distance on a map?
Is the Earth a perfect sphere for these calculations?
What is the difference between Euclidean and geodesic distance?
How do I get latitude and longitude for a city?
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.