
Web Scripts & Software
DEV3 Online Compass: True North, Bearing & Declination — Source Code (React + Tailwind)
from $20$29
Loading…
Everyday tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
At London, England, United Kingdom, magnetic north is 1.2° east of true north. Add 1.2° to a magnetic reading to get a true heading.
World Magnetic Model 2025 (epoch 2025.0, released 2024-11-13) by NOAA NCEI and the British Geological Survey, public domain. Typical accuracy is within 0.5°, worse near the magnetic poles.
Need Online Compass: True North, Bearing & Declination as a full mobile or web app? We build it in about a week. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The online compass: true north, bearing & declination stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Get the full app behind this tool. Buy once, own the source, and try each one live first.

Web Scripts & Software
from $20$29

Web Scripts & Software Mobile app
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Web Scripts & Software
from $69$99

Web Scripts & Software Mobile app
from $69$99

Web Scripts & Software Mobile app
from $69$99

Web Scripts & Software Mobile app
from $69$99
Modern phones contain a magnetometer, an accelerometer and a gyroscope. This page reads them to show a compass heading, a level bubble and a bearing to any place, and it adds the one thing most compass apps skip: the magnetic declination for where you are.
A compass needle follows the Earth's magnetic field, not the geographic pole. The angle between the two is the declination. In London it is a few degrees east, in parts of the north-east of America it is west by more than ten degrees. The page calculates it with the World Magnetic Model 2025 and shows how fast it changes each year. To turn a magnetic reading into a true heading, add an east declination or subtract a west one.
Phone compasses are good to a few degrees. Near the magnetic poles the field is almost vertical and a magnetic compass becomes unreliable. For navigation in the field carry a real compass and a map.
Press Start compass. On iPhone, Safari asks for motion and orientation permission. On Android, the page reads the absolute orientation sensor. Hold the phone flat and wait a second for the heading to settle.
True north is the direction to the geographic North Pole. Magnetic north is where a compass needle points. The angle between them is the magnetic declination, which depends on where you are and changes slowly over the years.
The page uses the World Magnetic Model 2025 from NOAA and the British Geological Survey. Its coefficients are built into the page, so no data is downloaded. Typical error is under half a degree away from the poles.
Metal, magnets, speakers and car bodies disturb the sensor. Move away from them and move the phone in a figure 8 to calibrate. A phone case with a magnetic clasp is a common cause.
Laptops and desktops do not have a magnetometer. The page says so and offers the Sun and stick method, which works from the time and your location.
No. Sensor readings and your location stay in the page. The city list loads only when you search.