If you want to calculate it yourself, then you can use the Haversine formula:

var rad = function(x) {
  return x * Math.PI / 180;
};

var getDistance = function(p1, p2) {
  var R = 6378137; // Earth’s mean radius in meter
  var dLat = rad(p2.lat() - p1.lat());
  var dLong = rad(p2.lng() - p1.lng());
  var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
    Math.cos(rad(p1.lat())) * Math.cos(rad(p2.lat())) *
    Math.sin(dLong / 2) * Math.sin(dLong / 2);
  var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
  var d = R * c;
  return d; // returns the distance in meter
};
Answer from Mike Williams on Stack Overflow
🌐
Google Maps Platform
mapsplatform.google.com › google maps platform › resources › blog › how calculate distances map maps javascript api
How to calculate distances between points with the Maps JavaScript API – Google Maps Platform
November 7, 2019 - function haversine_distance(mk1, mk2) { var R = 3958.8; // Radius of the Earth in miles var rlat1 = mk1.position.lat() * (Math.PI/180); // Convert degrees to radians var rlat2 = mk2.position.lat() * (Math.PI/180); // Convert degrees to radians ...
People also ask

What is the distance between two consecutive latitudes?

The distance between any two adjacent latitudes is approximately 69 miles or 111 km. Latitude lines run parallel to each other. That's why the distance between them remains constant from the South to the North pole. On the other hand, longitude lines are furthest apart at the equator and meet at the poles.

🌐
omnicalculator.com
omnicalculator.com › other › latitude-longitude-distance
Latitude Longitude Distance Calculator
What is the distance between the North and South pole?

The distance between the North and South pole is 20,015.09 km or 12,436.80 miles. The North pole, the northernmost point on the planet, is located at 90 degrees of latitude, while the South pole sits at -90 degrees.

🌐
omnicalculator.com
omnicalculator.com › other › latitude-longitude-distance
Latitude Longitude Distance Calculator
Where is the Prime Meridian located?

5.3 arcseconds or 102 meters east of the Royal Observatory, Greenwich. This location serves as the International Reference Meridian, which also acts as the reference meridian for the Global Positioning System or GPS. The zero longitude line was moved to account for local gravitational effects.

🌐
omnicalculator.com
omnicalculator.com › other › latitude-longitude-distance
Latitude Longitude Distance Calculator
🌐
Google Support
support.google.com › docs › thread › 137329980 › how-to-calculate-distance-between-latitude-longitude-coordinates
How to calculate distance between latitude & longitude coordinates? - Google Docs Editors Community
Skip to main content · Google Docs Editors Help · Sign in · Google Help · Help Center · Community · Google Docs Editors · Terms of Service · Submit feedback · Send feedback on
🌐
SunEarthTools
sunearthtools.com › tools › distance.php
Distance direction calculating between two location on the planet directly on the map
Drag the marker on map to calculate distance (km, meters, mile, foot) and bearing angle of direction on google map, between two points of the earth. Calculation of average speed or time spent. ... Valid value for the latitude are from -90.0° to 90.0° for the longitude are from -180.0° to ...
🌐
NOAA
nhc.noaa.gov › gccalc.shtml
Latitude/Longitude Distance Calculator
Latitudes and longitudes may be entered in any of three different formats, decimal degrees (DD.DD), degrees and decimal minutes (DD:MM.MM) or degrees, minutes, and decimal seconds (DD:MM:SS.SS). Important Note: The distance calculator on this page is provided for informational purposes only.
Find elsewhere
🌐
Labnol
labnol.org › google-maps-sheets-200817
Google Maps Formulas for Google Sheets - Digital Inspiration
Calculate distances between two cities or any addresses. Calculate the travel time (walking, driving or biking) between two points. Get the latitude and longitude co-ordinates of any address on Google Maps.
🌐
Quora
quora.com › How-can-I-calculate-the-distance-between-multiple-locations-given-by-their-latitude-longitude-coordinates-Google-Maps
How to calculate the distance between multiple locations given by their latitude/longitude coordinates (Google Maps) - Quora
Answer: When I was flying and when I was the navigator on several sailing trips, I used the following equations: A great circle route is the shortest distance between two points on a sphere (and earth). Hi is initial heading (0º being north and going to clockwise back to north at 360º), D is di...
🌐
Omni Calculator
omnicalculator.com › other › latitude-longitude-distance
Latitude Longitude Distance Calculator
January 18, 2024 - ... d = 2R × sin⁻¹(√[sin²((θ₂ - θ₁)/2) + cosθ₁ × cosθ₂ × sin²((φ₂ - φ₁)/2)]). ... The distance between any two adjacent latitudes is approximately 69 miles or 111 km.
🌐
Daft Logic
daftlogic.com › projects-google-maps-distance-calculator.htm
Distance Calculator
You can use this distance calculator to find out the distance between two or more points anywhere on the earth. In other words, the distance between A and B. Click once on the map to place the first marker and then click again to position the second marker. The distance between the points will ...
🌐
Medium
medium.com › analytics-vidhya › turn-right-in-2-miles-finding-distances-using-the-google-maps-api-and-pandas-fef8554f0b7d
Turn Right in 2 Miles: Simple Method to Find Distance Using the Google Maps API and Pandas | by Svideloc | Analytics Vidhya | Medium
January 18, 2020 - Before accessing the API, you will need to first create an account with the Google Maps Platform. Note that you will have to put payment information in, but you get $200 in monthly credit for free access. Additional pricing can be found here if you need to access the API more. Look to the Distance Matrix cell. I am using data from Kaggle, which can be found here. Depending on what you are doing with your data, you may want to calculate the distance differently. Below, I will discuss two popular ways to calculate distance using triangles (Pythagorean theorem).
🌐
Google Groups
groups.google.com › g › django-users › c › N18j8kvMDR4
Calculate distance between 2 latitude/longitude Point
a = sin(dLat/2) * sin(dLat/2) + cos(radians(latitude1)) * cos(radians(latitude2)) * sin(dLong/2) * sin(dLong/2) ... Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message ... Geopy has a distance function build ...
🌐
Calculator.net
calculator.net › home › math › distance calculator
Distance Calculator
In the haversine formula, d is the distance between two points along a great circle, r is the radius of the sphere, ϕ1 and ϕ2 are the latitudes of the two points, and λ1 and λ2 are the longitudes of the two points, all in radians.
🌐
Movable Type
movable-type.co.uk › scripts › latlong.html
Calculate distance and bearing between two Latitude/Longitude points using haversine formula in JavaScript
(Out of sheer perversity – I’ve ... and bearings in degrees (either decimal or degrees/minutes/seconds) need to be converted to radians, rad = deg⋅π/180....
🌐
Google
developers.google.com › google maps platform › web services › distance matrix api (legacy) › distance matrix api (legacy) overview
Distance Matrix API (Legacy) overview | Google for Developers
The Distance Matrix API calculates travel distance and time between multiple origins and destinations, supporting various modes of transport like driving, biking, transit, or walking · This API is ideal for optimizing logistics, such as determining efficient delivery routes or assigning workers ...
🌐
Map Developers
mapdevelopers.com › distance_finder.php
Google Maps Distance Calculator | Map Developers
To measure the distance on the google maps distance calculator tool. First zoom in, or enter the address of your starting point. Then draw a route by clicking on the starting point, followed by all the subsequent points you want to measure. You can calculate the length of a path, running route, ...
🌐
Google
developers.google.com › google maps platform › google earth › measure distances and areas
Measure distances and areas | Google Earth | Google for Developers
Learn how to measure distances in Google Earth Pro. ... Google Earth's measurements now include terrain statistics for paths (elevation and slope) and polygons (elevation). Placemarks include the ground elevation of the corresponding latitude and longitude point.
🌐
Latitude Longitude Data
latlongdata.com › home › distance calculator
Distance Calculator - Latitude Longitude Data
November 6, 2025 - In the "Start Location" field, enter a full address, city, or latitude/longitude coordinates in decimal format (e.g., 34.0522, -118.2437). In the "End Location" field, enter the destination address or coordinates using the same format. Click Calculate: Press the "Calculate" button to process ...