Distance Calculator

Distance calculator for the distance between two cities as the crow flies (flight / air distance), latitude/longitude coordinates, and 2D/3D points — a distance formula calculator and distance between two points calculator in one.

Updated

Type a city, country, or airport code (e.g., London, Japan, JFK)

Straight-Line (Great Circle / Air) Distance

2,450.9 mi (3,944.4 km)

From New York, NY (United States) (JFK) to Los Angeles, CA (United States) (LAX)

Global Coordinate Projection (Equirectangular)Initial Bearing: 273.7° (W)
JFKLAX

Drag to pan

Straight-line distance (US)
2,450.9 mi
Metric distance
3,944.4 km
Nautical distance
2,129.8 nmi
Est. commercial flight time
4h 57m
Initial compass bearing
273.7° (W)
Geographic midpoint
39.5103°, -97.1601°
Time zone difference
-3 hr (UTC-5 → UTC-8)
Haversine (spherical) distance
2,445.6 mi (3,935.7 km)

Was this tool helpful?

Leave a rating to help us build a better tool.

Average 0.0 / 5 · 0 reviews


Distance between two cities & latitude longitude distance calculator (Flight / air distance formulas)

This distance calculator finds the distance between cities as a city to city flight distance calculator, air distance calculator, and straight line distance calculator for major US and international cities—search by city name, country, or airport code—or between any two pairs of latitude and longitude. It also works as a distance between two points calculator for 2D and 3D coordinates.

Because the Earth is an oblate spheroid rather than a flat plane or a perfect sphere—with an equatorial radius of about 6,378.1 km (3,963.2 mi) and a flattening factor f = 1 / 298.257—the calculator provides both ellipsoidal and spherical surface distances:

  • Lambert's ellipsoidal formula (primary result): First converts geographic latitudes φ1 and φ2 into reduced latitudes β1 and β2 via tan(β) = (1 − f) tan(φ), computes the central angle σ between the reduced coordinates, and applies Lambert's flattening correction d = a(σ − (f / 2)(X + Y)), where P = (β1 + β2)/2, Q = (β2 − β1)/2, X = (σ − sin σ) sin²P cos²Q / cos²(σ/2), and Y = (σ + sin σ) cos²P sin²Q / sin²(σ/2). This achieves accuracy on the order of tens of meters over thousands of kilometers.
  • Haversine spherical formula (comparison result): Approximates the Earth as a sphere of mean radius r = 6,371 km using a = sin²(Δφ/2) + cos(φ1) cos(φ2) sin²(Δλ/2) and d = 2r arctan2(√a, √(1 − a)). Spherical Haversine estimates can differ by up to 0.5% from the ellipsoidal surface distance.

How to find distance between two points (Distance formula calculator)

For flat coordinates, the distance formula calculator computes Euclidean distance in a 2D coordinate plane or 3D space.

1. 2D distance calculator formula (Cartesian plane)

Derived from the Pythagorean theorem, the Euclidean distance d between two points (x1, y1) and (x2, y2) on a two-dimensional plane is:

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

Alongside the distance, the 2D mode calculates the midpoint ((x1 + x2)/2, (y1 + y2)/2), the horizontal and vertical changes (ΔX and ΔY), the slope m = ΔY / ΔX, the direction angle θ in [0°, 360°), and the slope-intercept equation of the line passing through both points.

2. 3D distance calculator formula (Three-dimensional space)

Extending the Pythagorean theorem to three dimensions, the distance between (x1, y1, z1) and (x2, y2, z2) is:

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

What the result includes

  • City-to-City & Latitude/Longitude straight-line distance in US statute miles, kilometers, and nautical miles using Lambert's ellipsoidal formula alongside the spherical Haversine estimate.
  • Navigation & travel metrics: Initial forward compass bearing, great-circle geographic midpoint, time zone difference, and estimated commercial airliner flight time.
  • World route map: The great-circle path drawn on an equirectangular world map that you can zoom and pan.
  • 2D & 3D Euclidean distance as both a decimal and an exact radical (√N), plus midpoint coordinates, ΔX/ΔY/ΔZ, slope, angle, line equation, and a 2D coordinate plot.

Important caveats

Geographic and city-to-city results represent straight-line (great-circle / air) distance along the Earth's surface. Actual driving distance along highways and local roads is typically 15% to 35% longer depending on terrain, bodies of water, and road networks, and actual commercial flight durations vary with wind speed (such as the jet stream), air traffic routing, and layovers.

Frequently asked questions

What is the distance between two cities as the crow flies?

"As the crow flies" means the straight-line (great-circle) distance along the Earth's surface, ignoring roads, terrain, and flight routing. The City to City tab returns exactly this distance between the two cities' coordinates using Lambert's ellipsoidal formula, in miles, kilometers, and nautical miles. Driving distance between the same two cities is usually longer.

How does the city to city distance calculator estimate flight time?

The City to City tab acts as a flight distance calculator and air distance calculator: it computes the great-circle air distance between the selected origin and destination coordinates, divides that distance in miles by a typical commercial jet cruising speed of 550 mph (885 km/h), and adds 30 minutes (0.5 hours) to account for takeoff, climb, descent, and approach.

Why do Lambert's formula and the Haversine formula give slightly different miles and kilometers?

The Haversine formula treats the Earth as a uniform sphere with a radius of 6,371 km (3,958.8 mi), whereas the real Earth bulges slightly at the equator (6,378.1 km) and flattens at the poles (6,356.8 km). Lambert's formula accounts for this ellipsoidal flattening, making it more accurate for long-distance geodesic calculations.

How to find distance between two points when Point 1 and Point 2 are swapped?

Whether you compute distance from Point 1 to Point 2 or from Point 2 to Point 1, the distance and midpoint are identical because (x2 − x1)² and (y2 − y1)² are squared in the distance formula. Swapping the two points negates ΔX and ΔY (which shifts the 2D direction angle θ by 180°) and changes the geographic initial bearing to the forward azimuth of the return great-circle path.

What's changed
  • Launched with City to City, Lat & Long, 2D Coordinates, and 3D Space tabs.