Great-circle distance between two lat/long points with the Haversine formula, plus bearing and midpoint, all in your browser
- Runs locally
- Category Calculator
- Best for Getting a realistic range before a purchase, plan, workout, or schedule decision.
What this tool does
A coordinate distance calculator that finds the great-circle distance between two latitude/longitude points using the Haversine formula on a spherical Earth with a mean radius of 6371 km. Type two decimal-degree points and read the distance at once in kilometres, miles, metres and nautical miles. It also gives the initial bearing from point A to point B as a degree value and a 16-point compass label such as NE or SSW, and the great-circle midpoint as its own lat/long pair. The math handles the cases a flat distance breaks on: pairs that cross the equator, pairs that cross the antimeridian near 180 longitude, and identical points that should return zero. Latitude is checked against the -90 to 90 range and longitude against -180 to 180, so a typo is caught before it skews the answer. One click copies the full result, and the URL carries all four coordinates so a shared link reopens the exact same pair. Everything runs locally in the page, with no server call and no coordinate ever uploaded.
Tool details
- Input
- Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 9 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Calculator · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How Coordinate Distance Calculator fits into your work
Use it for fast estimates, comparisons, and planning numbers before you make the final call.
Calculation jobs
- Getting a realistic range before a purchase, plan, workout, or schedule decision.
- Comparing scenarios by changing one input at a time.
- Turning rough assumptions into a number you can discuss.
Calculation checks
- Double-check units, dates, rates, and rounding assumptions.
- Treat health, finance, tax, and legal outputs as planning aids, not professional advice.
- Save the inputs that produced an important result so you can reproduce it later.
Good next steps
These links move the current task into a more complete workflow.
- 1 Unit Converter Convert between length, weight, temperature, area, volume, speed, time — instant, browser-only Open
- 2 Scientific Calculator Scientific calculator — sin / cos / log / sqrt / power, with full keyboard input + history, deg/rad mode. Open
- 3 Percentage Calculator 5 common percentage calculations — "x% of y", "x is what% of y", percentage change, increase/decrease — instant, browser-only Open
Real-world use cases
Estimate a flight or road leg between two cities
You have the coordinates of two cities and want the as-the-crow-flies distance before booking. Paste both lat/long pairs and read the great-circle distance in kilometres and miles at once. New York to Los Angeles returns about 3936 km, close to the published flight distance, so you can sanity-check a fare-per-km or a fuel estimate without a map.
Set a heading for sailing or hiking navigation
Planning a passage by boat or a long off-trail walk, you need the initial bearing as well as the distance. Enter your start and your waypoint and the tool gives the forward azimuth in degrees plus a compass label like NE, so you can set a heading on a handheld compass and know roughly how far the leg runs in nautical miles.
Find the meeting midpoint for two locations
Two people in different towns want to meet halfway. Drop both sets of coordinates in and the great-circle midpoint comes back as its own lat/long, which you can paste into a map to find a cafe or station near the geographic middle, rather than guessing from a road map.
Sanity-check a distance function while coding
Building a feature that computes distance between GPS points, you want a trusted reference value to test against. Feed your fixture coordinates here, copy the metre and kilometre output, and assert your own Haversine implementation lands within a percent. The exported pure functions mirror the textbook formula, so they make a clean oracle.
Teach or learn the Haversine formula with real numbers
Working through spherical trigonometry in a class, you want concrete input and output to check the formula by hand. Use the sample points, compare the distance, bearing and midpoint the tool reports, and trace each step. The share link reopens the exact example for a worksheet or a study group.
Common pitfalls
Swapping latitude and longitude. Latitude runs -90 to 90 and comes first; longitude runs -180 to 180. Entering 116 as a latitude is impossible and the tool flags it, but a value like 40 in both slots silently points somewhere wrong, so always confirm lat before long.
Mixing degrees-minutes-seconds with decimal degrees. This tool wants decimal degrees, so 40 degrees 42 minutes north is 40.7, not 40.42. Typing the minutes after the point inflates the position by a wide margin and throws the distance off by hundreds of kilometres.
Forgetting the sign for western longitude and southern latitude. West is negative and south is negative. Dropping the minus on a Los Angeles longitude (writing 118.24 instead of -118.24) places the point in the wrong hemisphere and balloons the distance.
Privacy
Every step runs as plain JavaScript inside your browser tab: the Haversine distance, the bearing, the midpoint and the unit conversions. No coordinate, result or share link is ever sent to a server, and nothing is logged. The one thing to know: the share URL encodes all four coordinates in the query string, so pasting a share link into a chat will record those coordinates in the recipient server's access log. For a sensitive location, use the copy button and paste the text instead of sharing the URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only
- AI Eval Planner Generate eval cases, pass criteria, and edge cases from an AI feature, risks, and user path.