Azimuth calculator
From London to Paris the initial bearing is 148.115617°, measured clockwise from true north. Enter the coordinates of the start and the destination in decimal degrees and get the direction of the great-circle route. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Lat1
- 51.5074
- Lon1
- -0.1278
- Lat2
- 48.8566
- Lon2
- 2.3522
- Azimuth degrees
- 148.115617
This azimuth calculator finds the initial great-circle bearing from one geographic point to another. Enter the latitude and longitude of the starting point and the destination, and it returns an angle in degrees clockwise from true north. A result near zero points north, 90 points east, 180 points south, and 270 points west. The calculation is deterministic, runs without a network request, validates every coordinate, and is suitable for navigation checks, geographic analysis, mapping tools, and repeatable software workflows.
Enter the two points in the correct order
Provide the starting point as lat1 and lon1, then provide the destination as lat2 and lon2. All four values use decimal degrees. Latitude measures position north or south of the equator and must stay between -90 and 90.
Longitude measures position east or west of the prime meridian and must stay between -180 and 180. Negative latitudes indicate the Southern Hemisphere, while negative longitudes indicate positions west of the prime meridian. The order matters because an azimuth describes a direction of travel: the bearing from London to Paris is not simply interchangeable with the bearing from Paris to London.
Use the exact coordinates from the same coordinate reference system, normally WGS 84 geographic coordinates. Do not swap latitude and longitude, and do not submit degrees-minutes-seconds notation as text. Convert such notation to signed decimal degrees first.
The calculator rejects missing values, non-finite numbers, out-of-range coordinates, and identical points, for which no travel direction exists.
Understand how the azimuth is calculated
The result is the initial bearing of the great-circle path from the first point to the second. Internally, the calculator converts each coordinate from degrees to radians, computes the longitude difference, and applies the standard spherical forward-azimuth formula with an atan2 operation. Using atan2 preserves the correct quadrant, which is essential because a simple inverse tangent cannot reliably distinguish northeast from southwest.
Angles increase clockwise from true north: 0 degrees is north, 90 degrees is east, 180 degrees is south, and 270 degrees is west. This is a true-north geographic bearing, not a magnetic compass heading, so it does not include magnetic declination. It is also an initial bearing.
On most long great-circle routes, the direction changes as the path progresses even though the route remains the shortest path over the spherical model.
Use the result with appropriate geographic precision
Treat the returned value as a clear, reproducible direction for geographic calculations rather than a complete navigation instruction. The formula models Earth as a sphere, which is accurate enough for many mapping, educational, routing-preview, and data-quality tasks. Surveying, aviation operations, marine navigation, and safety-critical guidance may require an ellipsoidal geodesic model, local regulations, current charts, magnetic variation, instrument corrections, and professional judgment.
Coordinate precision also limits useful bearing precision: rounded input coordinates can shift the angle, especially when points are close together or near a pole. Antimeridian crossings are handled naturally because the trigonometric formula works with the longitude difference, so a route near 180 degrees east or west does not need a special user option. Store the numeric result as degrees, preserve the original point order in your records, and label it as an initial true bearing when sharing it.
What you can do with it
Check a route direction
Calculate the initial true bearing from a departure coordinate to a destination before displaying a route arrow or directional summary.
Validate geographic datasets
Compare a recorded heading with the bearing implied by consecutive coordinate pairs and flag large discrepancies for review.
Build mapping features
Generate deterministic azimuth values for map annotations, directional labels, educational tools, or location-based application tests.
FAQ
What direction does zero degrees represent?
Zero degrees represents true north. Angles increase clockwise, so east is 90 degrees, south is 180 degrees, and west is 270 degrees.
Is this a magnetic compass bearing?
No. It is referenced to true north and does not apply local magnetic declination or compass corrections.
Why does reversing the points change the result?
An azimuth is directional, and great-circle routes generally do not have reverse initial bearings that differ by exactly 180 degrees.
What coordinate ranges are accepted?
Each latitude must be from -90 through 90, and each longitude must be from -180 through 180. All values must be finite numbers.
Does the bearing stay the same for the whole journey?
No. The result is the initial bearing of the great-circle path; on most long routes the direction changes as you travel, even though the path remains the shortest one over the sphere.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/geo/azimuth \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"lat1":51.5074,"lon1":-0.1278,"lat2":48.8566,"lon2":2.3522}'const res = await fetch("https://api.kit.forhosting.com/geo/azimuth", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"lat1": 51.5074,
"lon1": -0.1278,
"lat2": 48.8566,
"lon2": 2.3522
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/geo/azimuth",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"lat1": 51.5074,
"lon1": -0.1278,
"lat2": 48.8566,
"lon2": 2.3522
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/geo/azimuth", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"lat1":51.5074,"lon1":-0.1278,"lat2":48.8566,"lon2":2.3522}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"lat1":51.5074,"lon1":-0.1278,"lat2":48.8566,"lon2":2.3522}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/geo/azimuth", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"lat1": 51.5074,
"lon1": -0.1278,
"lat2": 48.8566,
"lon2": 2.3522
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "geo.azimuth",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Use the result with appropriate geographic precision
Browser use is available for interactive calculations, while an API request costs $0.002 and supports repeatable automation without network-dependent data sources inside the calculation itself.
Technical questions
What happens if both points are identical?
The request returns an invalid-input error because a point has no defined direction toward itself.
What does an API request cost?
Each API request costs $0.002. The same deterministic calculation can also run in the browser.