Travel calculators

Lat Long Distance Calculator

Updated Sep 29, 2026 By Infinity Calculator
Point A
Accepted range −90 to 90. Decimal, degrees + minutes, or DMS.
Accepted range −180 to 180. Decimal, degrees + minutes, or DMS.
Point B
Accepted range −90 to 90. Decimal, degrees + minutes, or DMS.
Accepted range −180 to 180. Decimal, degrees + minutes, or DMS.

Example values are pre-filled (Los Angeles → New York City) — Point A in decimal degrees, Point B in DMS — to show the accepted formats. Edit any field to use your own coordinates. Compass suffixes N, S, E and W are accepted; S and W are treated as negative.


Great-circle results

Coordinate output format
Distance — kilometres
— km
Distance — miles
— mi
Distance — nautical miles
— NM

Bearings & midpoint
Initial bearing (A → B)—
Final bearing (arriving at B)—
Great-circle midpoint—
Central angle—
WGS-84 ellipsoidal distance—
Coordinates used in this calculation
Point A—
Point A (decimal)—
Point B—
Point B (decimal)—
Distance in each unit — spherical vs. ellipsoidal model
Map — straight-line (great-circle) path

Step-by-Step Solution

Coordinate format converter (DMS ↔ decimal degrees)

Coordinate axis
Signed decimal, e.g. −118.2437
Degrees, decimal minutes, hemisphere
Degrees, minutes, seconds, hemisphere

Introduction

This Lat Long Distance Calculator finds the straight-line distance between two points on Earth. You type in the latitude and longitude of Point A and Point B, and it gives you the distance in kilometers, miles, and nautical miles.

The distance you get is the "great-circle" distance. That is the shortest path over the curved surface of the Earth, like the route a plane flies. It is not a road distance, so it will be shorter than a drive.

The tool also shows you:

  • The starting and ending compass bearing from A to B
  • The midpoint between the two places
  • A map with the path drawn on it
  • Step-by-step math using the haversine formula

You can enter coordinates three ways: decimal degrees (34.0522), degrees and minutes (34°03.13'N), or degrees, minutes, and seconds (34°03'08"N). Letters like N, S, E, and W work too. There is also a converter at the bottom to switch a coordinate from one format to another.

How to use our Lat Long Distance Calculator

Type the latitude and longitude of two places. The calculator shows the distance between them in kilometers, miles, and nautical miles, plus the bearing, midpoint, a map, and the math steps.

Latitude (Point A): Enter the north–south value of your first place, from −90 to 90. You can use decimal degrees (34.0522), degrees and minutes (34°03.13'N), or DMS (34°03'08"N).

Longitude (Point A): Enter the east–west value of your first place, from −180 to 180. South and West values are negative, so use a minus sign or the letter W.

Latitude (Point B): Enter the north–south value of your second place, from −90 to 90, in any of the same formats.

Longitude (Point B): Enter the east–west value of your second place, from −180 to 180.

Coordinate output format: Pick how you want the coordinates shown in the results: decimal degrees, degrees plus minutes, or degrees, minutes, and seconds.

Calculate Distance button: Click it to get your great-circle distance, bearings, midpoint, and step-by-step solution.

Swap Points button: Click it to trade Point A and Point B. This flips the direction of travel and updates the bearings.

Clear button: Click it to wipe the results and bring back the example coordinates.

Coordinate format converter: Pick latitude or longitude, then type a value in any one box. The other two boxes change to match, so you can switch between DMS and decimal degrees fast.

Latitude and Longitude Distance: What It Means

Every spot on Earth has two numbers that act like an address: latitude and longitude. Latitude tells you how far north or south you are from the equator, from −90° to 90°. Longitude tells you how far east or west you are from the Prime Meridian, from −180° to 180°. Give any two points these numbers, and you can measure the exact distance between them.

Great-Circle Distance

Earth is round, so the shortest path between two places is not a straight line on a flat map. It is a curve that follows the surface of the globe. That curve is called a great-circle path, and it is the shortest distance along the surface between two points.1 On a flat Mercator map the path looks bent, but it really is the shortest way.

The Haversine Formula

The haversine formula is a formula of spherical trigonometry for great-circle distance.1 Here it treats Earth as a perfect ball with a radius of about 6,371 km, Earth's mean radius.2 It finds the angle between the two points as seen from the center of Earth, then multiplies that angle by the radius. The answer is very close to the ellipsoid answer, but not exact.

Sphere vs. Ellipsoid

Earth is not a perfect ball. Its equatorial radius is 6,378.137 km and its polar radius 6,356.752 km.2 This calculator also works on the WGS-84 ellipsoid, a better model of that shape, using Vincenty's formula. Vincenty designed it to give full accuracy over lines of any length, from a few centimetres to nearly 20,000 km, so the ellipsoid answer is the more exact one.3

Bearing and Midpoint

Bearing is the compass direction you travel, given in degrees from 0° (north) going clockwise. A great circle's direction changes continually, so on a long route there is a starting bearing at the first point and a different final bearing when you arrive.1 The midpoint is the halfway spot along that curved path. It is not the plain average of the two sets of numbers, which is what the flat-plane Midpoint Calculator gives you.

Coordinate Formats

Coordinates can be written three ways, and they all mean the same place:

  • Decimal degrees (DD): 34.0522°, −118.2437°
  • Degrees and decimal minutes (DM): 34°03.13'N, 118°14.62'W
  • Degrees, minutes, seconds (DMS): 34°03'08"N, 118°14'37"W

One degree has 60 minutes, and one minute has 60 seconds. Letters show the side of the globe: N and E are positive, while S and W are negative. So 118°W is the same as −118°.

Units and Handy Facts

Distance can be shown in kilometers, miles, or nautical miles. One nautical mile equals exactly 1.852 km.6 It matches one minute of latitude, which is why sailors and pilots like it.5 One degree of latitude is always about 111 km. One degree of longitude is also about 111 km at the equator, but it shrinks toward the poles until it reaches zero.

Where This Is Used

Great-circle distance is used for flight planning, shipping routes, hiking and GPS apps, radio and antenna aiming, delivery zones, and school science projects.

Keep in mind that it measures the direct path over the surface. Real driving or flying distance is longer because roads bend, and planes must follow air routes and dodge weather. For road trips, a Travel Distance Calculator gives a much closer picture.


Formulas used

Haversine term a 1
a = \sin^2\!\left(\frac{\Delta\varphi}{2}\right) + \cos\varphi_1 \cos\varphi_2 \sin^2\!\left(\frac{\Delta\lambda}{2}\right)
Central angle
c = 2\,\mathrm{atan2}\!\left(\sqrt{a},\ \sqrt{1-a}\right)
Great-circle distance
d = R\,c, \qquad R = 6371.0088\ \text{km}
Unit conversions of distance
d_{mi} = d_{km} \times 0.621371192, \qquad d_{NM} = d_{km} \times 0.539956803
Initial bearing (A to B) 1
\theta_i = \mathrm{atan2}\!\left(\sin\Delta\lambda \cos\varphi_2,\ \cos\varphi_1 \sin\varphi_2 - \sin\varphi_1 \cos\varphi_2 \cos\Delta\lambda\right) \bmod 360^\circ
Final bearing (arriving at B) 1
\theta_f = \left(\theta_{B \to A} + 180^\circ\right) \bmod 360^\circ
Great-circle midpoint
\varphi_m = \mathrm{atan2}\!\left(\sin\varphi_1 + \sin\varphi_2,\ \sqrt{(\cos\varphi_1 + B_x)^2 + B_y^2}\right), \quad \lambda_m = \lambda_1 + \mathrm{atan2}\!\left(B_y,\ \cos\varphi_1 + B_x\right), \quad B_x = \cos\varphi_2 \cos\Delta\lambda,\ B_y = \cos\varphi_2 \sin\Delta\lambda
Coordinate conversion: DMS to decimal degrees 4
D_{dec} = \pm\left(d + \frac{m}{60} + \frac{s}{3600}\right)

Frequently asked questions

Where do I find the latitude and longitude of a place?

The easiest way is an online map. Right-click a spot in Google Maps and the coordinates pop up, ready to copy. Phone GPS apps, weather sites, and airport or port listings also show them. Copy the two numbers into the Point A or Point B boxes.

Do I have to type the degree symbol?

No. You can just use spaces. All of these work for the same place:

  • 34.0522
  • 34 3 8 N
  • 34°03'08"N

The calculator reads degrees, then minutes, then seconds, in that order.

When do I use a minus sign?

Use a minus sign for places south of the equator or west of the Prime Meridian. So Sydney's latitude is −33.87 and Los Angeles' longitude is −118.24. You can skip the minus if you add the letter instead: 33.87S or 118.24W means the same thing.

Why is my answer smaller than the distance on Google Maps?

This tool measures the direct path over the curve of the Earth. Roads bend around hills, lakes, and towns, so driving is always longer. Flights are longer too, because planes follow set air routes.

Why does the line on the map look curved?

Flat maps stretch the round Earth to fit a rectangle. That stretching bends the shortest path into an arc, mostly on long east–west trips. The curved line really is the shortest route.1

Does swapping Point A and Point B change the distance?

No. The distance stays the same. But the bearings change, because you are now heading the other way. Swap Points is handy for checking the return heading.

Why are there two bearings instead of one?

On a long route the compass heading slowly shifts as you go. The initial bearing is the heading when you leave Point A. The final bearing is the heading as you reach Point B. On short trips the two numbers are almost equal.

What is the central angle in the results?

It is the angle between your two points measured from the center of the Earth. Multiply that angle (in radians) by Earth's radius and you get the distance. It is the key step in the haversine math.

Why is the WGS-84 number a bit different from the main answer?

The main answer treats Earth as a perfect ball. The WGS-84 number treats it as a slightly squashed shape, which is closer to reality. The gap is small on most trips. Use the WGS-84 value when you need the most exact figure.

Does the distance include hills or altitude?

No. It measures across the surface at sea level. Climbing a mountain or flying at 35,000 feet adds a tiny bit of extra length, but it is far too small to matter for most trips.

Why do results show only 4 numbers?

Answers are rounded to 4 significant figures, like 3,936 km. That is more precision than the model itself can promise, so extra digits would be false accuracy. The Copy button copies that same rounded value.

Is it accurate for very short distances?

Yes, as long as your input has enough decimal places. Four decimals in decimal degrees is about 11 meters of precision.

What happens if the two points are on exact opposite sides of Earth?

The great-circle distance still works and comes out near 20,000 km. The WGS-84 line may say it is not available, because that formula cannot settle on an answer for near-opposite points.3

Can I put the same coordinates in both points?

Yes. The distance will be 0 and the midpoint will match your point. It is a quick way to test that you typed a coordinate correctly.

Why is the midpoint not the average of my two coordinates?

Because the path is a curve, not a straight line. The true halfway point sits on that curve, so it can be far from the plain average, especially on long trips near the poles.

The map did not load. Are my results still good?

Yes. The map is only a picture. If the tile map fails, a simple grid sketch shows instead. All distances, bearings, and the midpoint are still correct.

Why does it say my latitude is out of range?

Latitude only goes from −90 to 90, and longitude from −180 to 180. If you get this message, you likely swapped the two. A number like 118 belongs in the longitude box.

Can I turn this distance into a flight time?

Yes. Divide the distance by cruise speed, or use a Flight Time Calculator for a quicker estimate. Add extra time for taxi, climb, and descent.

Why are nautical miles included?

Sailors and pilots use them because one nautical mile equals one minute of latitude.5 That makes chart work simple. One nautical mile is about 1.852 km or 1.151 miles.6


Sources

  1. American Practical Navigator (Bowditch), Pub. No. 9, Volume II: Useful Tables, Calculations, Glossary of Marine Navigation, 2024 Edition. National Geospatial-Intelligence Agency. 2024;§ 147 Haversine Formulas, p. 206; § 903 Great Circles, pp. 284-285; § 913, pp. 298-299. Accessed September 29, 2026.
  2. Williams DR. Earth Fact Sheet. NASA Goddard Space Flight Center. 2024;Bulk parameters. Accessed September 29, 2026.
  3. Vincenty T. Direct and Inverse Solutions of Geodesics on the Ellipsoid with Application of Nested Equations. Survey Review. National Geodetic Survey. 1975;23(176):88-93. Accessed September 29, 2026.
  4. Newell DB, Tiesinga E, eds. The International System of Units (SI) (NIST Special Publication 330, 2019 Edition). National Institute of Standards and Technology. 2019;Table 8, p. 25. Accessed September 29, 2026.
  5. What is the difference between a nautical mile and a knot? National Ocean Service, NOAA. 2026. Accessed September 29, 2026.
  6. NIST Handbook 44 (2026), Appendix C: General Tables of Units of Measurement. National Institute of Standards and Technology. 2026;Units of Length, p. C-23. Accessed September 29, 2026.