ForHosting KIT · Travel & geography

Initial bearing calculator

Leaving London for Paris along the great circle, you set off on a bearing of 148.115617°, labelled SSE on the 16-point compass. Enter origin and destination in decimal degrees for a heading you can draw as an arrow or a bearing line. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Lat1
51.5074
Lng1
-0.1278
Lat2
48.8566
Lng2
2.3522
You get
Bearing
148.115617 deg
Cardinal
SSE

When you need the compass direction from one point on Earth to another, the initial bearing is the answer: the forward azimuth of the great-circle path as it leaves the origin. This calculator takes two pairs of latitude and longitude in decimal degrees and returns a single heading in the range 0 to 360 degrees, measured clockwise from true north. It uses the standard spherical formula that navigation libraries rely on, so the result is deterministic, free of network lookups, and suitable for route planning, map annotations, survey notes, and automated pipelines that must agree on the same number every time.

What initial bearing means (and what it is not)

Initial bearing, also called forward azimuth, is the angle at which you would set a compass if you started walking or flying along the shortest path on a sphere from point A toward point B. Zero degrees means due north, ninety means due east, one hundred eighty means due south, and two hundred seventy means due west.

Because Earth is curved, that heading is only correct at the start of the journey: as you travel along the great circle, the local compass direction required to stay on the geodesic usually changes. Final bearing (the reverse azimuth at the destination) is a different number; distance is yet another computation. This tool deliberately answers only the forward question so the contract stays simple: four coordinates in, one heading out.

Values are always normalized into the half-open interval from zero inclusive to three hundred sixty exclusive, which matches how most GIS systems and APIs express azimuth.

How to supply coordinates and read the result

Pass lat1 and lng1 for the origin and lat2 and lng2 for the destination, each as a finite number in decimal degrees. Latitudes must lie between minus ninety and ninety; longitudes between minus one hundred eighty and one hundred eighty. Positive latitude is north of the equator; positive longitude is east of the prime meridian.

Use the numeric bearing when you need precision for maps, bearing lines, or device orientation; use the cardinal only for display.

Where the formula is used in real systems

Logistics software draws arrows between warehouses and stops; drone ground stations show the heading toward the next waypoint; survey apps annotate the direction from a control point to a target; game maps orient markers toward quest destinations. All of those flows need a repeatable azimuth without calling an external geocoder.

The algorithm here is the classic spherical trigonometry identity: convert degrees to radians, form the east and north components with sine and cosine of the latitude and longitude deltas, then take atan2 of those components and wrap the result into zero through three hundred sixty. It assumes a spherical Earth, which is the same approximation used by countless open-source great-circle helpers and is accurate enough for most planning tasks under a few thousand kilometres.

For legal cadastral work or centimetre-grade surveying you would use an ellipsoidal geodesic library instead; for everyday routing, map UI, and educational tools this closed form is the right trade-off.

Route and waypoint orientation

Compute the departure heading between consecutive GPS fixes so a map UI or navigation strip can draw a direction arrow that matches the planned geodesic.

Logistics and field dispatch

Give drivers or field teams a true-north bearing from the depot to a delivery or job site without requiring a full turn-by-turn engine.

Survey notes and map annotations

Record the forward azimuth from a control point to a landmark in a form or spreadsheet pipeline that must stay deterministic across devices.

What is initial bearing?

It is the forward compass heading, in degrees clockwise from true north, of the great-circle path as it leaves the first coordinate toward the second.

Is the result magnetic north or true north?

True north. The calculator does not apply magnetic declination; apply a local variation table yourself if you need a magnetic compass reading.

Does the bearing stay constant along the whole path?

Usually not. Initial bearing is only the starting azimuth. On a sphere the local heading along a great circle generally changes; use final bearing at the destination if you need the arrival heading.

What coordinate format is accepted?

Decimal degrees only: lat1, lng1, lat2, lng2 as finite numbers. Degrees-minutes-seconds and plus-codes are not parsed; convert them first.

What bearing do I get if both points are the same?

Zero. With identical points there is no direction of travel, so the calculation settles on 0° as a stable convention instead of an undefined heading. Check your inputs if you see it unexpectedly.

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.

POSThttps://api.kit.forhosting.com/geo/bearing

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.

curl -X POST https://api.kit.forhosting.com/geo/bearing \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat1":51.5074,"lng1":-0.1278,"lat2":48.8566,"lng2":2.3522}'
{
  "lat1": 51.5074,
  "lng1": -0.1278,
  "lat2": 48.8566,
  "lng2": 2.3522
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.bearing",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

What initial bearing means (and what it is not)

If both points are the same location, the mathematical atan2 singularity resolves to zero, which is a stable convention for identical endpoints rather than an undefined heading.

How to supply coordinates and read the result

The response includes bearing rounded to six decimal places for stable automation, a unit field set to deg, the echo of from and to points so you can audit the request, and a sixteen-point cardinal label such as N, NE, or WSW for human-readable summaries. Because the arithmetic is pure and side-effect free, the free browser path and the paid API path produce the same JSON for the same input. Invalid or missing parameters fail with invalid_input and are not billed, so you can validate forms cheaply before committing a batch of waypoints.

Where the formula is used in real systems

API calls are priced at $0.002 per item on prepaid balance, with the same contract available for offline or browser execution where no account is required.

How much does the API cost?

Each successful request is billed at the published base price of $0.002 from prepaid KIT balance. Invalid input is not charged. The browser tool can run the same pure math locally without an account.

Read the full KIT documentation →