Distance Calculator

Calculated on this device
X-coordinate of Point 1
Y-coordinate of Point 1
X-coordinate of Point 2
Y-coordinate of Point 2
2D EUCLIDEAN DISTANCE
d = 5

Δx = 3 · Δy = 4

Midpoint(2.5, 3)

Great-circle distance models Earth as a sphere (R = 6,371.0088 km); local elevation is not included.

HOW IT WORKS

Euclidean coordinate & Haversine Earth formulas

Choose between flat Cartesian coordinates (2D or 3D) and spherical Earth coordinates (latitude and longitude in decimal degrees).

01

2D & 3D Euclidean Distance

Straight-line distance between two Cartesian points:

d₂D = √((x₂−x₁)² + (y₂−y₁)²) · d₃D = √(Δx² + Δy² + Δz²)
02

Haversine Great-Circle Distance

Shortest surface path on a sphere of radius R = 6,371.0088 km:

a = sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2) · d = 2R·atan2(√a, √(1−a))
03

Unit Conversions

Geographic distances use exact NIST SP 811 conversion factors:

1 statute mi = 1.609344 km · 1 nautical mi = 1.852 km

DISTANCE CALCULATION GUIDE

When to use Euclidean distance vs. Haversine great-circle distance

Flat planes vs. Earth's curvature

For engineering drawings, CAD grids, or classroom algebra, 2D and 3D Euclidean distance gives the exact straight-line length. If you also need the line's slope and equation, use our Slope Calculator. For cities, airports, or GPS coordinates across the globe, Earth's curvature matters—use Lat / Long mode to compute great-circle distance in kilometers, statute miles, and nautical miles.

Frequently asked questions

How accurate is the Haversine formula?

Because Earth is slightly oblate rather than a perfect sphere, the Haversine formula with mean radius 6,371.0088 km is typically within 0.3%–0.5% of ellipsoidal (WGS-84) geodesics.

How do I enter Southern or Western hemispheres?

Use negative decimal degrees: South latitudes are negative (e.g., -33.8688 for Sydney) and West longitudes are negative (e.g., -77.0366 for Washington, DC).

What is initial bearing?

Initial bearing (0° = North, 90° = East, 180° = South, 270° = West) is the compass heading at the starting point along the great-circle arc toward the destination.

Can 2D distance be negative?

No. Because differences are squared before taking the square root, distance is always zero (for identical points) or positive.