Flight Length Calculator
Despite the name, this tool measures one thing and measures it well: the great-circle distance between two points on Earth, worked from their latitude and longitude with the haversine formula. Enter the coordinates of a departure and an arrival point and it returns the shortest surface distance in miles, kilometers, or nautical miles. It does not estimate flight time, and the two airport code boxes are labels only: the four coordinate fields do all the work.
0
Formula used: haversine. Distance = 2 × R × atan2(√a, √(1−a)), where a = sin²(Δφ/2) + cos φ1 × cos φ2 × sin²(Δλ/2), R = 3,959 miles (Earth’s mean radius), φ is latitude and λ is longitude. This is a great-circle distance: real flown routes run longer.
Quick Answer
The pre-filled route, Los Angeles (34.0522, -118.2437) to New York City (40.7128, -74.0060), measures 2,445.71 miles on the great circle, which is 3,935.98 km or 2,125.26 nautical miles if you switch the unit. That is a distance, not a duration: this calculator has no speed input and returns no flight time.
Key takeaways
- Coordinates do the work. The two airport code boxes are labels that the calculation never reads, so a route is only as good as the four latitude and longitude values under them.
- Signs matter more than size: south latitudes and west longitudes are negative. One missing minus sign can move your arrival point to the wrong hemisphere.
- Great-circle distance is the floor, not the flight plan. Real routes add weather, airspace, and traffic detours on top of it.
- The spherical model runs up to about 0.3 percent away from ellipsoid results. Fine for planning, study, and content work; not a substitute for certified navigation data.
- Quick Answer
- How to use the flight length calculator
- The haversine formula, step by step
- Worked example: Los Angeles to New York City
- Why this distance is not your flight time
- Finding coordinates for any airport or city
- What competing calculators miss
- Frequently asked questions
- Add This Calculator to Your Website
- References
How to use the flight length calculator
Fill in four coordinates, pick a unit, and click Calculate. The Los Angeles to New York example is pre-filled so the first result takes one click.
- Label the route (optional): type the departure and arrival airport codes if it helps you keep track. Skip them entirely if you prefer: they do not affect the result, and the article says so on the fields themselves rather than letting you assume a code lookup happens behind the scenes.
- Enter the departure coordinates: latitude first, then longitude, in decimal degrees. West longitudes and south latitudes carry a minus sign.
- Enter the arrival coordinates the same way. If you only have place names, the section below on finding coordinates shows how to lift exact values from a map in seconds.
- Pick the unit: miles by default, kilometers, or nautical miles for aviation work. The underlying distance is identical; only the final conversion changes.
- Read the single result: one distance, to two decimal places, with the haversine formula printed under it so the number can be audited rather than trusted blindly.
Validation is strict and specific. A missing or non-numeric coordinate stops the calculation with a message asking for valid coordinates for both locations. A latitude outside -90 to 90 and a longitude outside -180 to 180 each get their own message, because each points at a different typing mistake, most often a swapped pair of fields.
The haversine formula, step by step
The haversine formula finds the great-circle distance, the shortest path over a sphere, from two coordinate pairs. It is the standard spherical method documented in Chris Veness's latitude and longitude calculation reference and in Ed Williams's Aviation Formulary, the reference collection long used for navigation mathematics.
c = 2 × atan2(√a, √(1 − a))
Distance = R × c, with R = 3,959 miles
Kilometers = miles × 1.60934 | Nautical miles = miles × 0.868976
Three details decide whether an implementation is trustworthy. First, every angle is converted to radians before the trigonometry, because degree values fed straight into sine and cosine are the classic silent error in hand-rolled versions. Second, the atan2 form of the formula is used rather than the older arcsine form, since it stays numerically stable for both very short hops and near-antipodal routes. Third, the radius is fixed at 3,959 miles, the mean Earth radius on the spherical model, so unit conversions are simple multiplications of one honest base number. Tooling such as MathWorks' Mapping Toolbox distance function documentation offers the same spherical option alongside ellipsoid models, which is exactly the trade-off described here: the sphere for speed and transparency, the ellipsoid when a fraction of a percent matters.
A flat-map shortcut would be simpler and wrong. Treating latitude and longitude as grid coordinates, the way the euclidean distance calculator correctly does for points on a plane, understates east-west travel more and more as latitude rises, because a degree of longitude shrinks toward the poles. The haversine's cosine terms are what correct for that shrinkage.
Worked example: Los Angeles to New York City
The pre-filled example runs from Los Angeles city coordinates (34.0522, -118.2437) to New York City coordinates (40.7128, -74.0060). The calculator returns 2,445.71 miles, and the steps below reproduce it by hand.
Four more real runs of this calculator are checked below, including the airport-coordinate version of a transatlantic route and the two edge cases readers actually hit.
| Route (coordinates) | Unit | Result |
|---|---|---|
| New York JFK (40.6413, -73.7781) to London Heathrow (51.4700, -0.4543) | Miles | 3,442.62 miles |
| Same JFK to Heathrow route | Kilometers | 5,540.34 km |
| Sydney (-33.8688, 151.2093) to London Heathrow (51.4700, -0.4543) | Miles | 10,573.69 miles |
| Same point twice (34.0522, -118.2437) to itself | Miles | 0.00 miles |
| Antipodal check: (0, 0) to (0, 180) | Miles | 12,437.57 miles |
The JFK to Heathrow row repays a second look. Airline references usually quote roughly 3,450 miles for that route, and this tool's 3,442.62 miles sits within a few miles of it, the small gap coming from the spherical model and the exact terminal coordinates chosen. The antipodal row is the formula's ceiling: half of Earth's circumference on this radius, and a good sanity check that no route you enter can legitimately exceed it.
Why this distance is not your flight time
A distance is not a duration, and this page will not pretend otherwise. There is no average-speed field hiding anywhere in the tool, no hidden 500 mph assumption, and no hours-and-minutes output to misread as a schedule.
If you need a rough duration, the honest hand method is to divide the distance by a realistic cruise ground speed, then add time for climb, descent, and routing. At a nominal 500 mph, the 2,445.71-mile example gives about 4.9 hours of pure cruise, before any of that padding, and headwinds on a westbound return can stretch the real flight well past the eastbound one on the same route. Treat any such figure as a planning sketch. If you want distance in all three units at once, plus a bearing and a built-in cruise-time estimate, the sibling air distance calculator is the richer tool; this page is the deliberately simpler one, a single distance in a single chosen unit. For ground journeys, where roads replace great circles entirely, the general distance calculator covers the point-to-point family from a different angle.
Finding coordinates for any airport or city
Coordinates are the only real input, so getting them right matters more than anything else here. Two habits cover almost every case.
- From a map: open any map app, drop a pin on the airport or city, and read the decimal pair it reports. Latitude comes first. On desktop map sites, a right-click on the point usually shows the coordinates directly.
- City versus airport: decide which point you actually mean. The pre-filled example uses city-centre coordinates for Los Angeles and New York, which is why its 2,445.71 miles differs slightly from airport-to-airport figures. Swapping in LAX's own coordinates (about 33.9416, -118.4085) and JFK's (40.6413, -73.7781) tightens the route to the airfields themselves. The USGS guide to what a degree, minute, and second cover is a useful sense-check on how much ground each decimal place represents: the fourth decimal place is roughly 11 meters, so four decimals are plenty for route work.
What competing calculators miss
Flight distance tools cluster into three types, and each makes a trade this page avoids or states openly:
- Airport-database tools (Travelmath and similar): type two codes or city names and get distance plus a flight time built on a fixed average speed and a fixed take-off and landing allowance. Convenient, but the time figure is a convention presented as a measurement, and you cannot audit which coordinates were used or test a point that is not in the database.
- Lat-long teaching tools: correct haversine mathematics, often with bearing and midpoint extras, but presented as code exercises. Several show all three units and a bearing while burying the actual Earth radius used, so two tools can disagree by miles with no visible reason.
- Government and agency calculators (such as NOAA's hurricane great-circle tool): authoritative and precise, built for a specialist job, with interfaces and unit choices aimed at forecasters rather than a traveller checking one route.
- The gap this page fills: any two points on Earth, not just database airports, with the radius and every conversion factor printed on the page, one clear unit choice, strict range validation, and an honest refusal to invent a flight time it does not compute.
Frequently asked questions
No. It returns the great-circle distance only, in the unit you pick. There is no speed input and no duration output, so any flight time has to be estimated separately from the distance and a realistic cruise speed, then padded for climb, descent, routing, and wind.
The departure and arrival airport code boxes are labels only. The calculation reads just the four latitude and longitude fields, so typing LAX and JFK without coordinates, or changing the codes while keeping the same coordinates, gives exactly the same distance. Use the codes as a note for which route you measured.
Use the airport's own latitude and longitude in decimal degrees, with south latitudes and west longitudes as negative numbers. Los Angeles International, for example, sits near 33.9416, -118.4085, while the pre-filled Los Angeles city coordinates are 34.0522, -118.2437. City coordinates are fine for planning; airport coordinates are tighter for route work.
This is the shortest surface path between the two points, the great-circle route. Real flights detour around weather, restricted airspace, and traffic flows, and they climb and descend, so flown mileage is usually a few percent longer. Schedules also include taxi and turnaround padding that a distance tool never sees.
Miles for road-trip intuition in the United States, kilometers for most of the world, and nautical miles for aviation and maritime work, where speeds are quoted in knots and charts are built around the nautical mile. All three come from the same haversine distance; only the final conversion factor changes.
The two coordinate pairs describe the same point, so the distance between them is zero. Check for a copied field: the most common cause is pasting the departure coordinates into the arrival boxes as well.
The formula models Earth as a sphere with a radius of 3,959 miles. Against an ellipsoid model such as WGS84, spherical results typically differ by up to about 0.3 percent, which is a few miles on a transcontinental route. That is plenty for planning and study; surveyed or certified navigation work needs the ellipsoid model.
Latitudes must sit between -90 and 90 and longitudes between -180 and 180, because those are the full ranges of the coordinate system. A value outside them is usually a swapped pair: if your longitude looks like a latitude, the two fields have been entered in each other's boxes.
Add This Calculator to Your Website
Embed this calculator on your own site with the code below. Pick a size to preview it live, then copy the code.
Powered by Calculator Zilo
References
- Chris Veness, Movable Type Scripts. Calculate distance and bearing between two latitude/longitude points using the haversine formula. Accessed October 21, 2026.
- Ed Williams. The Aviation Formulary: great-circle distance and course mathematics. Accessed October 21, 2026.
- National Oceanic and Atmospheric Administration, National Hurricane Center. Great Circle Calculator: latitude/longitude distance tool. Accessed October 21, 2026.
- U.S. Geological Survey. How much distance does a degree, minute, and second cover on your maps? Accessed October 21, 2026.
- MathWorks. Distance function: great-circle and rhumb distances on a sphere or ellipsoid (Mapping Toolbox). Accessed October 21, 2026.
