Distance Calculator

Calculate the distance between any two cities or GPS coordinates using the great-circle (Haversine) formula. Get the result in kilometers, miles or nautical miles, along with the initial bearing and a live compass direction. 200+ world cities built in. Free, no signup.

City not found? Type latitude,longitude — e.g. 40.7128,-74.0060

Distance
Pick two cities to see the distance

What Is a Distance Calculator and How Does It Work?

A distance calculator measures the shortest distance between two points on Earth's surface. Because the Earth is approximately spherical, this distance is not a straight line through the planet but the length of the arc that follows the surface — known as the great-circle distance or "as-the-crow-flies" distance. This is the same calculation used by airline route planners, GPS systems and navigation apps to compute the minimum distance between two coordinates.

This calculator uses the Haversine formula, the standard great-circle method, which is accurate to within ~0.5% for distances anywhere on Earth. It takes the latitude and longitude of two points, accounts for the Earth's curvature using a mean radius of 6,371 kilometers, and returns the distance along the surface. The calculator runs entirely in your browser — no data is sent to any server, and over 200 major world cities are built in for instant lookup.

How to Use This Distance Calculator

Calculating the distance between any two locations takes seconds:

Step 1 — Enter the first city. Start typing the name (for example, New York) and pick a suggestion from the dropdown. The built-in database covers 200+ major world cities across every continent.

Step 2 — Enter the second city. Same flow. If your city isn't in the database, type GPS coordinates directly in the format latitude,longitude (for example, 40.7128,-74.0060 for New York).

Step 3 — Choose your unit. Toggle between kilometers (default), miles or nautical miles. All three values are always visible in the summary card below.

Step 4 — Read the result. The hero number shows the great-circle distance, and the compass card displays the initial bearing (the direction you would head from the first point) along with its 16-point cardinal label.

Great-Circle Distance vs Driving Distance

The distance shown by this tool is the great-circle distance — the theoretical shortest path between two points on the globe. It's the same metric used by long-haul flights and ships at sea. Driving distance is different: it depends on the actual road network, terrain, water bodies and traffic patterns, and is typically 20–40% longer than the great-circle distance for road travel.

For example, the great-circle distance from New York to Los Angeles is about 3,936 km. The actual driving distance via the Interstate Highway System is roughly 4,500 km — about 14% more. For walking or running routes, the difference is even greater. If you need a precise driving distance, use a routing service like Google Maps or OpenStreetMap; this calculator gives you the "as the crow flies" baseline.

The Haversine Formula Explained

The Haversine formula computes great-circle distance using the haversine of an angle (where hav(θ) = sin²(θ/2)). The full formula is: a = sin²(Δφ/2) + cos(φ₁)·cos(φ₂)·sin²(Δλ/2), where φ is latitude and λ is longitude in radians. The central angle is then c = 2·atan2(√a, √(1−a)), and the distance is d = R·c, where R is Earth's mean radius. The Haversine formula is preferred over the simpler law-of-cosines approach because it remains numerically stable for very small distances.

Bearing and Compass Direction Explained

The initial bearing (also called forward azimuth) is the compass direction you would set off in from the first point to reach the second along the great-circle route. It is measured clockwise from true north, from 0° (due north) to 360°. Unlike the bearing on a flat map, the great-circle bearing changes continuously during a long journey — which is why pilots use a series of waypoints rather than holding a constant heading.

This calculator also displays the bearing as a 16-point cardinal label: N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW. A bearing of 51° is labeled "NE" (northeast), 200° is "SSW" (south-southwest), and so on.

Common Uses: Travel, Logistics, Aviation

Distance calculators have many practical applications:

Distance Calculation Examples

New York → London (transatlantic)
From: 40.7128, -74.0060   To: 51.5074, -0.1278
Distance: 5,570 km · 3,461 miles · 3,008 nautical miles
Initial bearing: 51° (NE)
Paris → Tokyo (Europe → Asia)
From: 48.8566, 2.3522    To: 35.6762, 139.6503
Distance: 9,712 km · 6,035 miles · 5,244 nautical miles
Initial bearing: 32° (NNE) — the great-circle route flies over Siberia
Sydney → Los Angeles (transpacific)
From: -33.8688, 151.2093  To: 34.0522, -118.2437
Distance: 12,070 km · 7,500 miles · 6,517 nautical miles
Initial bearing: 56° (NE)

Frequently Asked Questions

Great-circle distance is the shortest distance between two points on the surface of a sphere — in this case, Earth. It follows the arc of a great circle (a circle whose center is at the center of Earth). It is the metric used by long-haul flights and is sometimes called the "as-the-crow-flies" distance. It is shorter than any driving route because it cuts across in a straight surface line, ignoring roads, terrain and obstacles.

The Haversine formula is accurate to within about 0.5% for distances anywhere on Earth. It assumes Earth is a perfect sphere with a mean radius of 6,371 km, which is a small simplification — Earth is actually a slightly flattened spheroid. For most practical purposes (travel, logistics, education), Haversine is more than precise enough. For survey-grade work over short distances, the Vincenty formula on an ellipsoid model is used instead.

1 kilometer ≈ 0.621371 miles ≈ 0.539957 nautical miles. Conversely, 1 mile ≈ 1.60934 km, and 1 nautical mile ≈ 1.852 km. This calculator shows all three values at once, so you can compare without converting manually. Nautical miles are mainly used in aviation and shipping because they correspond to one minute of latitude.

A bearing is the compass direction from one point to another, measured clockwise from north (0° to 360°). On a flat map, you can hold a constant bearing to follow a straight line. But on a sphere, the great-circle route curves on a flat map, and the bearing changes continuously along the path. This calculator shows the initial bearing: the direction you would head off in from the first point. Pilots compensate by adjusting course at intervals or using a rhumb line for shorter trips.

No. Driving distance depends on the road network and requires a routing service (Google Maps, OpenStreetMap, etc.). This tool computes the straight-line great-circle distance, which is usually 20–40% shorter than the actual driving route. Use it as a baseline or for travel that doesn't follow roads (flying, sailing, point-to-point measurement).

Use decimal degrees in the format latitude,longitude — for example 40.7128,-74.0060 for New York City. Latitude ranges from -90 (South Pole) to +90 (North Pole), and longitude from -180 to +180 (with negative values for the Western Hemisphere). The calculator accepts spaces around the comma but not the older degree/minute/second (DMS) format — convert DMS to decimal first.

The built-in database covers 200+ major cities across every continent. If your city isn't listed, look up its coordinates (Wikipedia, Google Maps, etc.) and paste them as latitude,longitude directly into the From or To field. The calculator will accept the manual input and compute the distance.

Yes. This tool runs entirely in your browser. The 200+ city database is embedded in the page, the math is computed locally, and your selections are saved only on your device. No data is sent to any server, no signup is required, and there is no tracking beyond standard anonymous analytics.