Distance Calculator API — Calculate Distance Between Two GPS Points
Calculate the great-circle distance between two GPS coordinates. Get distance in kilometers, miles, and nautical miles. Free API.
What is Distance Calculation?
The distance calculator uses the Haversine formula to calculate the great-circle distance between two points on Earth given their latitude and longitude. It returns distance in kilometers, miles, and nautical miles with configurable precision.
How to Use It
Call GET /api/v1/distance?lat1=59.91&lng1=10.75&lat2=48.85&lng2=2.35. Returns { from: { lat: number, lng: number }, to: { lat: number, lng: number }, distance_km: number, distance_miles: number, distance_nm: number }.
Try it live
Test this endpoint in the interactive console
Open Console →
Frequently Asked Questions
What formula is used?
The Haversine formula, which calculates the great-circle distance between two points on a sphere. This accounts for the Earth's curvature.