Skip to content

As the Crow Flies Distance Calculator: How Great-Circle Distance Is Actually Calculated

By Muhammad Javaid IqbalReviewed by Muhammad Awais13 min readUpdated 30 September 2026

As the crow flies distance calculator math: how the haversine formula computes great-circle distance between two coordinates on Earth, worked through step by step with real city pairs and its accuracy limits.

Two straight lines connect New York and London: the one an as the crow flies distance calculator draws, about 5,570 kilometers over the curved surface of the Earth, and the one nobody can actually fly, straight through the planet's crust. As the crow flies distance is the first of those, the shortest path along the surface, and it is one of the oldest and most misunderstood ideas in distance measurement. This piece works through exactly how it is calculated, with the arithmetic shown at every step, why it is not the same number your GPS app gives you for a drive, and where the formula itself starts to lose accuracy.

The short version: as the crow flies distance comes from the haversine formula, a piece of spherical trigonometry that treats the Earth as a sphere and works out the shortest arc between two latitude and longitude points along its surface. Everything below unpacks that sentence, term by term, with real coordinates.

Where "as the crow flies" comes from

Crows do not actually fly in straight lines, corvids are known for indirect flight paths around obstacles like anything else, so the phrase is a figure of speech, not an ornithological fact. It shows up in English by at least the early 1800s as a way to describe a direct line between two places, in contrast to the winding distance of a road or river route between the same two points. Sailors and surveyors had already been solving the more technical version of the same problem for centuries, working out the shortest path between two points on a globe for navigation, long before the crow idiom was recorded in print.

That older technical problem is what this post is really about. A ship's navigator plotting a course between two ports needed the shortest arc across a curved ocean surface, not a straight line drawn on a flat chart, because a straight line on a flat chart is not actually the shortest real-world path once the Earth's curvature is accounted for. The mathematics that solves this is called great-circle distance, and "as the crow flies" is simply the everyday name for the same result.

The haversine formula, step by step

A great circle is any circle drawn on a sphere's surface whose center is also the sphere's center, the largest possible circle you can draw on a ball. The equator is one example; every line of longitude, paired with its opposite line on the far side of the planet, is another. The shortest path between any two points on a sphere always lies along the great circle that passes through both of them, which is the geometric fact the whole formula is built on.

The haversine formula finds the length of that arc from two latitude/longitude pairs. Written out, with φ (phi) for latitude and λ (lambda) for longitude, both in radians:

a = sin²(Δφ/2) + cos(φ1) · cos(φ2) · sin²(Δλ/2)
c = 2 · asin(√a)
d = r · c

Δφ is the difference in latitude between the two points, and Δλ is the difference in longitude. The formula works in three stages. First, a combines the latitude gap and the longitude gap, scaled by how far the two points sit from the equator, since a degree of longitude covers less real ground near the poles than it does at the equator. Second, c turns that combined value into a central angle, measured in radians, between the two points as seen from the center of the Earth. Third, multiplying that angle by the Earth's radius, r, converts an angle into an actual distance, since arc length equals radius times angle in radians. A mean radius of 6,371 kilometers is the standard constant used here.

The name "haversine" comes from "half a versed sine," an old trigonometric function, haversine(θ) = sin²(θ/2), that mostly fell out of general use once calculators made it unnecessary, but survives inside this one formula because of a real numerical advantage. An older, more direct approach (the spherical law of cosines) technically computes the same central angle, but it loses precision for points that are close together, where the cosine of a tiny angle rounds to almost exactly 1 in floating-point arithmetic and washes out the small differences that matter. The haversine version stays numerically stable at any distance, from two points a few meters apart to two points on opposite sides of the planet, which is the whole reason it is the version everyone actually implements.

Worked example: New York to London

New York City sits at approximately 40.7128°N, 74.0060°W. London sits at approximately 51.5074°N, 0.1278°W. Converting to the sign convention the formula needs, west longitudes are negative, so New York is (40.7128, -74.0060) and London is (51.5074, -0.1278).

The latitude difference, Δφ, is 51.5074 minus 40.7128, which is 10.7946 degrees. The longitude difference, Δλ, is -0.1278 minus -74.0060, which is 73.8782 degrees. Converted to radians (multiplying by π/180), Δφ is about 0.18840 radians and Δλ is about 1.28942 radians.

Plugging into the formula: sin²(Δφ/2) works out to about 0.008848, and cos(40.7128°) · cos(51.5074°) · sin²(Δλ/2) works out to about 0.75799 × 0.62241 × 0.36116, which is about 0.17039. Adding those two pieces gives a of about 0.17924. Taking the square root and applying asin doubles back into an angle, c, of about 0.87431 radians. Multiplying by the Earth's radius, 6,371 kilometers, gives a distance of about 5,570 kilometers, or 3,461 miles after converting with the standard 0.621371 kilometers-to-miles factor.

That figure matches the commonly published great-circle distance between the two cities closely; small differences between sources usually come down to whether the calculation used airport coordinates, city-center coordinates, or a slightly different Earth radius, not a different formula.

Three more worked examples, short and long

A single example never proves a formula works generally, so here are three more, chosen to cover a short regional hop and a longer cross-country pair.

Boston to New York City is a short regional distance: Boston at (42.3601, -71.0589) to New York at (40.7128, -74.0060) comes out to about 306 kilometers, or 190 miles, as the crow flies. San Francisco to Los Angeles, (37.7749, -122.4194) to (34.0522, -118.2437), comes out to about 559 kilometers, or 347 miles. Houston to Dallas, (29.7604, -95.3698) to (32.7767, -96.7970), comes out to about 362 kilometers, or 225 miles, noticeably farther than the roughly 235 kilometers (146 miles) from Houston to the closer city of Austin.

Every one of these is meaningfully shorter than the equivalent road trip, because a great circle ignores the highway network entirely. That gap is small over a short, direct hop like Houston to Austin and grows on routes where the road network has to work around terrain, coastline, or simply does not run in a straight line between the two points.

Great-circle distances at a glance

A short reference table, all computed with the same haversine formula above, useful for sanity-checking any calculator against a known figure.

City pairGreat-circle distance (km)Great-circle distance (mi)
New York to London5,5703,461
San Francisco to Los Angeles559347
Boston to New York306190
Houston to Dallas362225
Houston to Austin235146
Portland to Seattle234145
Austin to San Antonio11874

Every row in that table is the straight-line figure, not a driving distance. The distance calculator reproduces any of these directly: enter the two latitude/longitude pairs above on its Lat/Long tab, or click both cities on its Map tab, and it returns the same number.

More city pairs people look up

The same formula reproduces the pairs readers search for most often. Each figure below is the straight-line distance, so every road, rail or flight route between the same cities is longer.

City pairGreat-circle distance (km)Great-circle distance (mi)
Detroit to Chicago381237
LA to Las Vegas368228
Pittsburgh to New York507315
Pittsburgh to Philadelphia414257
San Francisco to San Diego738458
Barcelona to Paris831516
Boston to Philly436271
Philadelphia to Washington DC198123
Atlanta to DC873542
Boston to Washington DC634394
Boston to Montreal403250
Baltimore to Philadelphia14490
San Jose to Los Angeles492305
Denver to Los Angeles1,336830
SFO to ORD2,9641,842

As a rule of thumb, road distances run roughly 10 to 30 percent above the straight-line figure, depending on terrain and how the road network is laid out. The airport pair, SFO to ORD, uses the airports' own coordinates, so it differs slightly from a city-centre to city-centre figure for San Francisco and Chicago. Use the table as a sanity check on any distance tool: a driving or flying distance that comes out shorter than the straight-line figure for the same two points means something is wrong with the inputs.

All figures in these two tables use a mean Earth radius of 6,371 kilometers and convert to miles by dividing by 1.609344. A different radius, such as the equatorial 6,378 kilometers, shifts every figure by about 0.1 percent, which is why two calculators can disagree in the last digit without either one being wrong. Rounding to the nearest kilometer or mile, as the tables do, hides that difference completely.

Why the formula assumes a perfect sphere

The Earth is not a perfect sphere. It is an oblate spheroid, very slightly flattened at the poles and bulging at the equator, a shape produced by its own rotation over geological time. The equatorial radius is about 6,378.137 kilometers and the polar radius is about 6,356.752 kilometers under the WGS84 reference standard used by GPS, a difference of about 21 kilometers, small compared to the planet's size but not zero.

The haversine formula sidesteps that detail entirely by using a single mean radius, 6,371 kilometers, splitting the difference. For most purposes this is close enough that the resulting error is not worth worrying about, typically within a small fraction of a percent of a more precise ellipsoidal calculation. Formulas that do model the flattening, most notably Vincenty's formula and the newer Karney algorithm, solve the same shortest-path problem on an ellipsoid instead of a sphere, at the cost of a noticeably more involved calculation. Surveying, geodesy and aviation-grade navigation reach for one of those instead of the haversine formula when the extra precision matters; everyday distance lookups, mapping software and this calculator do not need it.

Real-world uses of an as the crow flies distance calculator: flights, ships and radius search

Long-haul flight planning starts from a great-circle path, which is why a flight from New York to Tokyo, viewed on a globe, curves up over the North Pole region rather than heading straight west, that curved-looking path is in fact the shortest possible route between the two airports; it only looks curved because the map projection distorts it. Shipping routes work the same way for open-ocean legs, adjusted afterward for currents, weather routing and traffic separation schemes near busy coastlines.

A more everyday use sits behind a feature most people have used without naming it: "restaurants within 5 miles" or "jobs within 25 kilometers" on almost any search or maps app. That radius search is essentially an as the crow flies distance calculator, a haversine calculation running in the background, checking whether each candidate location's great-circle distance from you falls inside the radius you asked for. It is fast precisely because it does not need to calculate an actual driving route for every candidate first, it only needs the straight-line distance to filter the list down before anything more expensive happens.

Edge cases worth knowing

Two points at the exact same coordinates correctly return a distance of zero, since Δφ and Δλ are both zero and the whole formula collapses to zero without any special-case handling required.

Antipodal points, meaning two points on exactly opposite sides of the planet, such that a straight line between them passes through the Earth's center, produce the maximum possible great-circle distance: about 20,015 kilometers, or roughly 12,437 miles, exactly half of Earth's circumference. Madrid and a point in the ocean near New Zealand sit close to being antipodes of each other, and a haversine calculation between two such near-opposite points comes out close to that ceiling. No two points on Earth can be farther apart than that figure, no matter which formula computes the distance.

Crossing the 180th meridian, the antimeridian near the international date line, is handled correctly by the formula as written, since it only ever works with the difference between two longitude values, not their absolute position, so a pair of points on either side of that line still produces the correct short-way-around distance rather than an inflated one that goes the long way around the globe.

Common mistakes when computing this by hand

Forgetting to convert degrees to radians before applying the trigonometric functions is the single most common bug, since every one of sin, cos and asin in a programming language's math library expects radians, not degrees, and a result computed with raw degree values comes out wrong by a large, confusing factor rather than failing loudly.

Swapping latitude and longitude is the second most common mistake, and one of the quieter ones, because both are ordinary numbers within overlapping ranges near the equator and prime meridian, so a swapped pair does not always produce an obviously broken result, it just quietly describes the wrong two points.

Using the wrong Earth radius, or mixing a radius given in miles with coordinates expected to produce kilometers, is the third. Pick one radius, in one unit, and convert the final answer afterward if the other unit is needed, rather than trying to swap constants mid-calculation.

Working all of this out by hand is a useful exercise exactly once, to confirm the formula makes sense; after that, the distance calculator's Lat/Long and Map tabs run the identical formula instantly, in either kilometers or miles, without any risk of a degrees/radians slip. For the flat-plane version of distance, the kind that applies to coordinate geometry rather than real-world coordinates, the same page's 2D and 3D tabs cover that separately, and the Pythagorean theorem calculator and slope calculator cover the closely related geometry of a straight line between two plotted points.

Frequently asked questions

Is as the crow flies distance the same as driving distance?

No, and it is never longer than driving distance, only shorter or, in the rare case of a perfectly straight road, equal to it. As the crow flies distance is the great-circle line between two coordinates, ignoring every road, hill and building in between. Driving distance follows the actual road network, which curves around all of that, so it is essentially always the bigger number.

Why doesn't this match the distance my GPS app shows me?

Because a GPS app is almost always reporting a route, not a straight line. Turn-by-turn navigation calculates the shortest or fastest path along real roads, adds up every segment, and reports that total, which includes every curve, on-ramp and detour a straight-line formula never sees. The two numbers answer different questions and are not supposed to match.

Can I use the haversine formula for flight distance between airports?

As a close estimate, yes, and airlines do use great-circle paths as the starting point for long routes, since a great circle is the shortest possible path between two points on a sphere. The actual flown distance is a little longer once air traffic control routing, weather diversions and holding patterns are added, so treat a haversine result as a lower bound on the real flight distance, not an exact figure.

What is the difference between the haversine formula and the Vincenty formula?

The haversine formula treats the Earth as a perfect sphere. The Vincenty formula (and other ellipsoidal methods) model the Earth as the oblate spheroid it actually is, very slightly flattened at the poles and bulging at the equator. For most everyday purposes the two agree closely; the gap becomes worth caring about for survey-grade or aviation-grade work, where the sphere assumption can be off by a small fraction of a percent depending on the two points chosen.

Does the great-circle formula work over very short distances, like across a city?

Yes, it stays accurate at any scale, from a few blocks to halfway around the planet, because it is exact spherical trigonometry rather than an approximation that only works at one distance range. Over a short distance the great-circle answer and a flat-plane approximation converge anyway, since a small enough patch of a sphere is nearly flat, but the haversine formula itself does not need that approximation to stay correct.

What is the longest possible great-circle distance between two points on Earth?

About 20,015 kilometers, or roughly 12,437 miles, exactly half of Earth's circumference. That maximum is only reached between two points that are perfect antipodes of each other, meaning a straight line through the planet's center connects them. Any two points that are not exact antipodes have a shorter great-circle distance than that ceiling.

Why do flight paths on a map look curved instead of straight?

Because a flat map projection distorts the Earth's curved surface, and a straight line on a curved surface does not stay straight once it is flattened onto paper or a screen. The flight path is the genuinely shortest route, the great circle; it only looks bent because the map it is drawn on has to stretch a sphere into a rectangle to display it at all.

How far is Dallas from Houston as the crow flies?

About 225 miles (362 kilometers) in a straight line. The drive is longer, because the highway follows a curved, built-up corridor rather than the great circle.

How far is San Diego from Los Angeles in a straight line?

About 111 miles (179 kilometers). That is also the answer to how far is San Diego from LA if you measure along the great circle rather than the freeway.

How far is Boston from New York, and how far is Philadelphia from NYC?

Boston to New York is about 190 miles (306 kilometers) as the crow flies. Philadelphia to NYC is about 81 miles (130 kilometers), which also answers how far is Philly from New York in a straight line.

How far is Austin from Houston, and how far is Dallas from Austin?

Houston to Austin is about 146 miles (235 kilometers), and Dallas to Austin is about 182 miles (293 kilometers). Both are straight-line figures; road distances run somewhat longer.

How far is Tampa from Miami, and how far is Memphis from Nashville?

Tampa to Miami is about 206 miles (331 kilometers) in a straight line, and Memphis to Nashville is about 196 miles (316 kilometers). Flights and highways add distance to both.

What does a search like 'get distance as the crow flies' actually need?

Two points, each as a latitude and longitude, and a formula that treats Earth as a sphere. The haversine formula is the usual choice because it stays accurate for short distances, where simpler spherical formulas lose precision.

Why do travelmath-style sites and the distance formula in physics give different answers?

They solve different problems. A travel site usually reports the great-circle distance on Earth's curved surface, while the distance formula in physics, the square root of the sum of squared coordinate differences, assumes a flat plane or three-dimensional space.

Put this into practice with the free Distance Calculator.