Magnetic declination calculator
If a landmark lies at 50° true and your compass reads 45°, the local declination is 5° east. Enter both bearings of the same point and get the signed offset between true north and magnetic north. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- True bearing
- 50
- Magnetic bearing
- 45
- Declination
- 5
- Declination abs
- 5
- Direction
- east
Magnetic declination is the signed angle between true geographic north and the north a magnetic compass actually points toward. This calculator recovers that angle from two observations of one reference point: the true bearing taken from a map, a chart, or a GPS true course, and the magnetic bearing read from a compass. Declination equals true bearing minus magnetic bearing, wrapped to the shortest signed angle, with east positive and west negative. The engine is pure deterministic arithmetic: no world magnetic model lookup, no network, no randomness, and no date.
What magnetic declination is and how two bearings recover it
Magnetic declination, also called magnetic variation in aviation and marine practice, is the signed horizontal angle from true geographic north to magnetic north at a given place. When magnetic north lies east of true north the declination is positive; when it lies west the declination is negative. This page recovers that angle from two bearings of one reference point rather than from a world magnetic model.
Because both angles describe the same line of sight, their difference is exactly the offset between the two norths: declination equals true bearing minus magnetic bearing. The result is then wrapped onto the shortest signed interval so a pair such as true ten degrees and magnetic three hundred fifty degrees becomes twenty degrees east instead of a raw minus three hundred forty.
The engine never fetches IGRF or WMM coefficients, never consults the current date, and never invents a station table: if you do not already have both bearings, this calculator cannot guess the declination for you.
Where declination-from-bearings is used, and what this tool does not do
Orienteering classes, survey labs, and wilderness courses often stand on a mapped landmark, read a compass bearing, and ask for the local declination instead of copying a chart rose that may be years out of date. Pilots and mariners use the same two-angle check when a runway or a headland has a published true azimuth and the wet compass disagrees. GIS technicians convert a field magnetic sight and a known true grid azimuth into a signed offset before storing traverses.
Compass deviation from ship steel or aircraft electronics is out of scope. If you need compass-rose names, rhumb-line courses, or great-circle azimuths between coordinates, use those dedicated tools.
What you can do with it
Field compass check on a mapped landmark
Sight a charted peak or tower, enter its true map bearing and the compass reading, and recover the local east-positive declination without opening a world magnetic model.
Survey and orienteering lab worksheets
Grade two-bearing declination drills with a deterministic oracle that rejects out-of-range angles instead of silently wrapping a typing error into a plausible heading.
FAQ
How is magnetic declination computed from two bearings?
East of true north is positive; west is negative. The wrap keeps the result on the shortest signed arc in (−180, 180] degrees.
What range are the true and magnetic bearings allowed to have?
Each bearing must be a finite number in the closed range from 0 to 360 degrees.
What does a negative declination mean?
A negative declination means magnetic north lies west of true north (west variation). A positive value is east. Zero means the two norths coincide for that sighting.
Does this tool look up declination from my location or the current year?
No. You supply both bearings. There is no latitude, longitude, or date input, and the engine does not call a world magnetic model.
What does the magnetic declination calculator cost?
It is free in your browser on this page.
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/phys/magnetic-declination \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"true_bearing":50,"magnetic_bearing":45}'const res = await fetch("https://api.kit.forhosting.com/phys/magnetic-declination", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"true_bearing": 50,
"magnetic_bearing": 45
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/magnetic-declination",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"true_bearing": 50,
"magnetic_bearing": 45
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/magnetic-declination", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"true_bearing":50,"magnetic_bearing":45}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"true_bearing":50,"magnetic_bearing":45}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/magnetic-declination", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"true_bearing": 50,
"magnetic_bearing": 45
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.magnetic_declination",
"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.
Limits
bearing_min_deg | 0 |
bearing_max_deg | 360 |
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
Any bearing outside the closed range from zero to three hundred sixty degrees is rejected with invalid_input rather than silently wrapped. Run it free in the browser, or call the API at $0.002 per successful request when you need the same number in a pipeline.
What magnetic declination is and how two bearings recover it
The true_bearing field is the clockwise angle from geographic north to the landmark, taken from a topographic map, a charted meridian, or a GPS true course. The magnetic_bearing field is the clockwise angle from magnetic north to the same landmark, read on a compass or a magnetic heading display.
Input contract, the 0 to 360 range, and signed wrapping
Unlike a converter that quietly folds four hundred five degrees back into forty-five, this calculator rejects any bearing strictly below zero or strictly above three hundred sixty, because an out-of-range sighting is more often a transcription error than a modular heading. Zero and three hundred sixty are both accepted as due north. Failed validation is not billed. POST a JSON body with two required finite numbers: true_bearing, the geographic clockwise angle in degrees, and magnetic_bearing, the compass clockwise angle in degrees of the same reference point. Aliases true_heading, geographic_bearing, and T are accepted for the true angle; aliases magnetic, mag_bearing, compass_bearing, and M are accepted for the compass angle, so spreadsheets and typed forms can reuse the same contract. Each value may arrive as a JSON number or as a numeric string; empty strings, NaN, Infinity, and non-numeric tokens fail with invalid_input naming the field. On success the payload echoes both bearings, returns declination as the signed east-positive angle wrapped onto the open-closed interval from minus one hundred eighty exclusive to plus one hundred eighty inclusive, returns declination_abs as the magnitude, and labels direction as east, west, or none when the offset is exactly zero. A short formula string restates the identity, the method tag is magnetic_declination, and units are degrees. Pair the free browser run on this page with the priced API at $0.002 per successful item when you need identical goldens in CI.
Where declination-from-bearings is used, and what this tool does not do
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns.
Integration use cases
Deterministic navigation fixtures
Generate reproducible declination, declination_abs, and east/west direction values for unit tests, property checks, and CI assertions in mapping software.