Angle Between Two Bearings Calculator
The angle between two bearings calculator finds the smallest separation between any two compass directions.
Run — free
Enter both bearings in degrees, and it normalizes each direction before comparing them, so values outside the usual zero-to-360-degree range still work. The result is always an absolute angle from zero through 180 degrees. This makes crossings at north behave correctly: for example, 350 degrees and 10 degrees are only 20 degrees apart, not 340 degrees apart.
How to enter and interpret two bearings
Enter the first and second compass bearings as numbers measured in degrees clockwise from north. A bearing of 0 degrees points north, 90 points east, 180 points south, and 270 points west. Decimal values are accepted, which is useful when a navigation instrument or calculation reports a course more precisely than a whole degree. The inputs may also be negative or greater than 360 because the calculator normalizes each one to the equivalent direction within a complete turn. For example, -10 degrees describes the same direction as 350 degrees, while 725 degrees describes the same direction as 5 degrees. The returned angle is an absolute separation, so changing the order of the two bearings does not change the answer. A result of 0 degrees means both values indicate the same direction. A result of 180 degrees means the directions are exactly opposite. Every other result identifies the shorter turn between them, without labeling that turn port, starboard, left, right, clockwise, or counterclockwise.
Why ordinary subtraction can give the wrong angle
Compass bearings lie on a circle, so their numerical endpoints meet: 0 degrees and 360 degrees represent north. Simply subtracting one bearing from another ignores that circular boundary. If the bearings are 350 and 10 degrees, direct subtraction produces an absolute difference of 340 degrees, even though the directions sit just 20 degrees apart across north. The calculator first wraps both inputs into the interval from 0 up to, but not including, 360. It then takes the absolute direct difference. When that difference is greater than 180, it uses the complementary part of the circle, calculated as 360 minus the direct difference. This guarantees the smallest possible angle and limits the answer to 180 degrees. The method also handles equivalent turns consistently: 10 and 370 degrees produce zero, and -90 and 90 degrees produce 180. No trigonometric approximation is needed, so ordinary finite degree inputs produce a deterministic result suitable for repeatable calculations and automated checks.
Using the result in navigation and planning
The smallest angle is useful whenever the size of a directional change matters more than its signed direction. A navigator can compare a planned course with a reported heading, a surveyor can check the separation between two azimuths, and a route planner can measure how sharp a change in direction will be. The result alone does not say which way to turn. If one bearing is 20 degrees and the other is 300 degrees, the smallest separation is 80 degrees, but choosing clockwise or counterclockwise requires a separate signed-turn convention and knowledge of which bearing is the starting direction. This calculator deliberately avoids that ambiguity by returning only the absolute minimum. It also does not account for magnetic declination, local compass deviation, wind, current, or the geometry of travel over Earth. Convert both observations to the same reference, such as both true or both magnetic bearings, before comparing them. For automated use, each request costs $0.002; the same deterministic calculation can be run free in the browser.
What you can do with it
Compare a heading with a planned course
Measure the smallest magnitude of the difference between the vessel or aircraft heading and the intended bearing.
Check survey azimuth separation
Find the acute, right, obtuse, or opposite angular separation between two surveyed directions, including directions across north.
Evaluate route direction changes
Calculate how large a turn is between consecutive route bearings without treating the zero-degree boundary as a large detour.
FAQ
What range can the result have?
The result is always between 0 and 180 degrees, inclusive.
Can I enter negative bearings or values above 360 degrees?
Yes. Every finite input is normalized to its equivalent compass direction before the difference is calculated.
Why are 350 degrees and 10 degrees only 20 degrees apart?
The directions straddle north, where the compass scale wraps from 360 back to 0. The shorter path across that boundary is 20 degrees.
Does the answer tell me whether to turn left or right?
No. It is an absolute smallest angle. A signed or directional turn requires a defined starting bearing and clockwise or counterclockwise convention.
Can I compare a true bearing with a magnetic bearing?
Convert them to the same reference first. Magnetic declination or compass deviation is not applied by this calculator.
What does the API request cost?
Each API request costs $0.002. The browser calculation is free.
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/trig/angle-between-bearings \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"first_bearing":350,"second_bearing":10}'const res = await fetch("https://api.kit.forhosting.com/trig/angle-between-bearings", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"first_bearing": 350,
"second_bearing": 10
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/angle-between-bearings",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"first_bearing": 350,
"second_bearing": 10
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/angle-between-bearings", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"first_bearing":350,"second_bearing":10}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"first_bearing":350,"second_bearing":10}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/angle-between-bearings", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"first_bearing": 350,
"second_bearing": 10
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.angle_between_bearings",
"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. |