Lat Long Distance Calculator
Enter Coordinates
Point 1
Point 2
About This Tool
What Is the Lat Long Distance Calculator?
The Lat Long Distance Calculator is a free online tool that computes the great-circle distance between any two points on Earth, given their latitude and longitude coordinates in decimal degrees. Enter the coordinates of two locations, choose a calculation method, and the tool instantly returns the distance in kilometres, miles, and nautical miles along with the initial bearing from the first point to the second. All calculations run in your browser — no server round-trip, no data sent anywhere.
Understanding Latitude and Longitude
Latitude and longitude are the two coordinates in the geographic coordinate system that together specify any location on Earth's surface. Latitude measures the angular distance north or south of the equator, ranging from −90° at the South Pole to +90° at the North Pole. The equator itself is at 0°. Longitude measures the angular distance east or west of the prime meridian — an arbitrary reference line that passes through the Royal Observatory in Greenwich, London — ranging from −180° to +180°. Together, a latitude/longitude pair uniquely identifies every point on the globe.
This tool uses decimal degree format, which is the most common format in digital mapping and GPS systems. For example, New Delhi is at latitude 28.6139, longitude 77.2090, and New York City is at latitude 40.7128, longitude −74.0060 (negative because it is west of the prime meridian).
What Is a Great-Circle Distance?
The great-circle distance is the shortest path between two points along the surface of a sphere. Because the Earth is (approximately) spherical, the shortest route between two cities curves as it follows the surface of the globe — this curve is called a geodesic or great-circle route. This is why long-haul flights travel routes that appear curved on a flat map but are actually the most direct path in three-dimensional space.
Great-circle distance differs from Euclidean (straight-line) distance, which would pass through the Earth's interior and is therefore not physically meaningful for surface navigation. It also differs from rhumb-line distance (the path that crosses all meridians at the same angle), which is easier to navigate using a constant compass bearing but is longer than the great-circle route for most journeys.
Calculation Methods Explained
Haversine Formula
The Haversine formula is the recommended method for computing great-circle distances. It is numerically stable across all distances — including very short ones, where other methods can suffer from floating-point precision loss. The formula takes the latitudes and longitudes of both points in radians, computes the Haversine of the central angle between them, and then multiplies by the Earth's mean radius (6,371 km) to produce a distance in kilometres. The result is accurate to within approximately 0.3%, because the formula assumes a perfectly spherical Earth while the real Earth is slightly flattened at the poles.
Spherical Law of Cosines
The Spherical Law of Cosines is a simpler formulation that uses basic spherical trigonometry. It calculates the central angle using the arccosine of a product of sines and cosines of the latitudes and longitudes. For most practical distances — anything above a few kilometres — it gives results that are virtually identical to the Haversine formula. However, it can lose precision for very small distances due to the limited resolution of floating-point arccosine operations. For navigation and educational purposes it is a clear and accessible formula.
What Is Bearing?
Bearing describes the compass direction from one point to another. It is measured in degrees clockwise from true north, ranging from 0° (north) to 360° (also north, completing the full circle). An initial bearing of 90° means you would travel due east; 180° means due south; 270° means due west. The tool also converts the bearing into a compass abbreviation — N, NE, ENE, E, and so on — using 16-point compass notation.
Note that the initial bearing (also called forward azimuth) is the direction at the departure point, not a fixed compass heading for the entire journey. On a great-circle route, the bearing changes continuously as you travel because the route curves to follow the sphere's surface. This is why long-distance navigation uses waypoints to periodically correct the heading.
Practical Applications
The ability to calculate distances from coordinates has many real-world applications. Aviation and maritime navigation rely on great-circle calculations to determine the most fuel-efficient routes between airports or ports. GPS and mapping applications use the same formulas under the hood to give turn-by-turn distances. Geospatial data analysis — clustering nearby events, finding nearby points of interest, or calculating how far seismic data was recorded from its epicentre — all rely on coordinate-based distance calculations. Scientists tracking migration patterns, ecologists mapping habitat ranges, and logistics companies optimising delivery routes all use these fundamental formulas.
Input Format and Validation
The tool accepts coordinates in decimal degree format only. Latitude must be between −90 and +90; longitude must be between −180 and +180. Positive latitude values are north of the equator; negative values are south. Positive longitude values are east of the prime meridian; negative values are west. If you have coordinates in degrees-minutes- seconds (DMS) format, convert them first using the formula: decimal degrees = degrees + (minutes / 60) + (seconds / 3600). For example, 28°36'50"N converts to 28 + 36/60 + 50/3600 = 28.6139.
How to Use This Tool
Enter the latitude and longitude of the first location in the Point 1 fields, and the latitude and longitude of the second location in the Point 2 fields. Select a calculation method from the dropdown — Haversine is recommended for most uses. Click Calculate Distance to see results. The result panel shows the distance in kilometres, miles, and nautical miles, along with the initial bearing and its compass direction. Click Copy to copy the results as plain text. Click Reset to clear all fields and start a new calculation.
Frequently Asked Questions
Yes, Lat Long Distance Calculator is totally free :)
Yes, you can install the webapp as PWA.
Yes, any data related to Lat Long Distance Calculator only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.
The Lat Long Distance Calculator computes the great-circle distance between two geographic points specified by their latitude and longitude coordinates. It supports two calculation methods — Haversine and Spherical Law of Cosines — and returns results in kilometres, miles, and nautical miles simultaneously.
Both methods assume a spherical Earth model. The Haversine formula is numerically stable for all distances including very short ones, making it the recommended default. The Spherical Law of Cosines is a simpler formula that can suffer from floating-point precision loss for very small distances (under ~1 km) but is accurate for most practical purposes.
A great-circle distance is the shortest path between two points on the surface of a sphere, following the curve of the Earth. It is the basis for long-distance navigation and differs from a straight-line Euclidean distance, which would pass through the Earth's interior.
The tool accepts decimal degree format (e.g., 28.6139 for latitude and 77.2090 for longitude). Latitude ranges from −90 (South Pole) to +90 (North Pole); longitude ranges from −180 to +180. Negative latitude means south of the equator; negative longitude means west of the prime meridian.
The initial bearing shows the compass direction you would travel from Point 1 towards Point 2 at the moment of departure. It is expressed in degrees (0°–360°) measured clockwise from true north, along with a compass abbreviation such as NE, SSW, or W.
Both methods model the Earth as a perfect sphere with a radius of 6,371 km. Real-world accuracy is within about 0.3–0.5% for the Haversine method. For higher-precision geodesy (such as surveying), the Vincenty ellipsoidal formula offers greater accuracy, but for navigation and general use the Haversine result is more than sufficient.