The full guide
How to use the compass
Four steps to a reading you can trust, what to expect on your particular device, and the two settings that change what the number means.
Getting a reading
Four things, in this order
The order is the method. A calibration done next to a laptop bakes the laptop's field into the correction.
-
01 Step
Start the compass
Press Start compass. Your browser will ask permission to read the device's orientation, because a page cannot read a sensor without you saying so. Nothing is read before you press it.
On a desktop, drag the rose or use the arrow keys instead
-
02 Step
Hold the device flat
Lay the phone flat in your palm, screen up, as level as you can manage. A magnetometer reads a three-dimensional field and the correction for tilt gets worse the further from level you are. Held upright like a camera, the reading can be tens of degrees out.
Level matters more than steady
-
03 Step
Step away from metal, then calibrate
Move a couple of metres from laptops, speakers, desks, cars and magnetic cases, then move the device in a figure of eight two or three times. That lets it sample the field from several angles and solve for the local offset.
A magnetic case or car mount will defeat this entirely
-
04 Step
Choose true or magnetic north
Read the bearing, and pick which north it is measured from. True for anything to do with a map, a panel or a dish; magnetic for a bearing you took with a physical compass. The readout names the nearest of the 16 points so you have a direction as well as a number.
True north needs a declination figure, magnetic does not
Your device
What happens on what
iPhone and iPad
- Press Start compass. iOS shows a one-time prompt asking to allow motion and orientation access.
- Allow it. iOS requires the request to come from a tap, which is why the compass cannot start on its own.
- If no prompt appears, check Settings, Safari, Motion & Orientation Access is on, then reload.
iPhone also ships a Compass app, and Apple Maps shows a heading cone.
Android
- Press Start compass. Chrome on Android generally grants orientation access without a prompt on an https page.
- If the needle does not move, the device may have no magnetometer. Budget and older tablets often do not.
- Check Settings, Site settings, Motion sensors if you have previously blocked it.
Google Maps shows a heading cone, and calibrating there also calibrates this page.
Desktop and laptop
- There is almost certainly no magnetometer, so there is no live heading to read.
- The rose is fully usable anyway: drag it to any bearing, or focus it and use the arrow keys.
- Arrow keys step one degree, Shift and arrow steps one point, Home returns to north.
A few 2-in-1 laptops do have a magnetometer. If yours does, Start compass will work.
No device at all
- The sun rises roughly east and sets roughly west, and is due south at local noon in the northern hemisphere.
- An analogue watch, the shadow-stick method and the night sky all give you north to within a few degrees.
- Each of those has its own page under Find a direction, with the error you should expect.
Two norths
True north or magnetic north?
These are different directions, and the angle between them where you stand is called magnetic declination, or variation. It can be under a degree or over twenty depending on where you are, and it changes slowly over years.
Use true north
For anything drawn on a map
Maps, site plans, property boundaries, solar panels, satellite dishes, the qibla. All of these are specified against the map, and the map means true.
Use magnetic north
For a bearing off a physical compass
A baseplate compass reads magnetic. If you are following a bearing you took with one, or one printed as magnetic on a chart, stay in magnetic and do not correct twice.
Why this site asks you for the figure
Most compass sites will happily compute a declination for you. This one asks you to supply it, and the reason is worth explaining, because it looks like a missing feature and it is a deliberate one.
Doing it accurately means the World Magnetic Model: a degree-12 spherical harmonic expansion of the earth's field, 168 coefficients, revised every five years. Doing it cheaply means a centred-dipole approximation, which treats the field as a single tilted bar magnet and returns the bearing to the geomagnetic pole.
The cheap version was built here and measured against published values before being taken out. These are its actual errors:
- London
- Model −15.0°, actual +0.3°. Wrong by 15.3°.
- New York
- Model +0.3°, actual −13.1°. Wrong by 13.4°.
- Tokyo
- Model +5.6°, actual −8.0°. Wrong by 13.6°.
- São Paulo
- Model −4.2°, actual −21.6°. Wrong by 17.4°.
The non-dipole part of the earth's field is simply too large to ignore, badly so over Europe and the South Atlantic. A true north that is fifteen degrees wrong is worse than no true north at all, because it is wrong quietly and it carries the authority of a computed number.
So the compass has a field for it. Get your figure once from NOAA's magnetic model and calculator, paste it in, and true north becomes available. East is positive, west is negative.
Your location is still useful and still optional. It gives your coordinates, and it gives the qibla, which is exact spherical trigonometry rather than a model of a field. Both are computed in your browser, so your coordinates never leave the device.
Sensor hygiene
Why calibration works
A magnetometer does not measure direction. It measures field strength along three axes, and the direction is inferred from the three numbers. Anything that adds a steady field of its own shifts all three by a constant, and the inferred direction comes out wrong by a constant amount.
Calibration measures that constant so it can be subtracted, and it needs readings from many orientations to separate a fixed offset from the earth's field. That is the whole reason the figure-of-eight motion exists: each new orientation is another equation in the solve.
Telling interference from miscalibration
Turn slowly through a full circle and watch the bearing.
- Smooth but offset. Every reading wrong by roughly the same amount, changing evenly as you turn. That is miscalibration. Do the figure of eight.
- Lumpy. The bearing sticks, jumps, or runs fast through part of the turn and slow through the rest. That is interference. Move somewhere else; calibrating will not fix it and may make it worse.
The usual culprits
Magnetic phone cases and car mounts, laptops, monitors, speakers and headphones, steel-framed desks, reinforced concrete, cars, lifts, and bicycle handlebars. A phone compass wants open air and a couple of metres of clearance from anything ferrous.
Permissions
What is asked, and what is kept
Two permissions, both optional, both requested only when you press the button that needs them.
DeviceOrientationEvent
Motion and orientation
- When it is asked
- Only when you press Start compass, never on page load.
- What it is used for
- To read the angle your device is held at, which is the compass heading.
- What is kept
- Nothing. The angle is drawn to the screen and replaced by the next reading, roughly sixty times a second. It is never stored and never transmitted.
Geolocation
Location
- When it is asked
- Only when you press Use my location, and it is entirely optional.
- What it is used for
- To show your coordinates, and to compute the qibla, which is the great-circle bearing from where you are to the Kaaba. It is not used for the declination, which this site asks you for rather than estimating.
- What is kept
- Nothing. The coordinates stay in the page for as long as the tab is open and are discarded when you close it. They are never stored and never transmitted.
Keyboard
Setting a bearing by hand
Focus the rose and it becomes a rotational control. This is the only way to use the compass on a machine with no magnetometer, so it is a first-class path rather than a fallback.
- Left and Right, Up and Down
- One degree per press.
- Shift and an arrow
- One point of the rose, 11.25 degrees.
- Page Up and Page Down
- 45 degrees, one ordinal point.
- Home
- Back to north, 000.
- End
- South, 180.
Questions
Getting a reading
Does an online compass actually work?
On a phone or tablet, yes. Modern devices have a real magnetometer, and the browser exposes its output to this page in the same way a native compass app reads it. The number you see is measured hardware, not a guess.
On a desktop or laptop, no. Almost none have a magnetometer, so there is nothing to read. The rose on this page is still fully usable there, but you turn it yourself: drag it, or use the arrow keys. It is a working model of a compass card rather than a live instrument, and the page says which mode you are in.
Why does it ask permission before starting?
Because a page that can read the angle your device is held at can infer a surprising amount, so browsers put that behind an explicit grant. On iOS the grant must come from a tap, which is why there is a Start compass button rather than a compass that is already running.
Nothing is read before you press it, and nothing is kept after. The angle is drawn to the screen and thrown away on the next frame.
I pressed Start and nothing happened.
Three things cause this. The page has to be served over https, or the browser blocks sensor access outright. The permission prompt has to be accepted, and if you dismissed it once, Safari and Chrome both remember that and will not ask again until you clear the site settings.
The third is simply that the device has no magnetometer. Desktops, most laptops and some budget tablets do not. In that case the page falls back to the hand-turned rose and tells you so rather than showing a needle that is quietly lying.
The needle drifts, or points somewhere obviously wrong.
A magnetometer measures the earth's magnetic field, which is weak, so anything closer and stronger wins. The usual culprits are a magnetic phone case or car mount, a laptop, speakers, a metal desk or a car body. Step a couple of metres away from all of it and the reading usually settles immediately.
If it still wanders, the sensor needs recalibrating: hold the device away from your body and move it in a figure of eight two or three times. This is not a superstition, it is the device sampling the field from several orientations so it can solve for the offset.
Can I use it in a car, a plane or a lift?
Not reliably. A car and a lift are both steel boxes, which distort the field enough to make the reading meaningless, and a plane is worse. A phone compass wants open air and a couple of metres of distance from anything ferrous.
Questions
True north and magnetic north
What is the difference between true north and magnetic north?
True north is the direction of the geographic north pole, which is the north on every map. Magnetic north is the direction a magnetised needle points, and it is somewhere else entirely: the magnetic pole sits in the Arctic Ocean and moves tens of kilometres a year.
The angle between the two, from wherever you are standing, is called magnetic declination or magnetic variation. It can be nearly zero, or it can be more than twenty degrees, depending on where you are.
Which one should I use?
Use true north if you are working with a map, a property boundary, a solar panel or a satellite dish. All of those are specified against the map, and the map means true.
Use magnetic north if you are following a bearing you took with a physical compass, or reading one off a chart that gives magnetic bearings. Mixing the two is the single most common navigation mistake, and over a few kilometres a twenty degree error puts you a long way from where you meant to be.
Why does this site not work out the declination for me?
Because the only way to do it accurately is with the World Magnetic Model, a spherical harmonic expansion with 168 coefficients that are revised every five years, and the only way to do it cheaply is an approximation that is badly wrong.
The cheap version was built and tested here before being removed. A centred-dipole model came out 15 degrees off in London, 13 in New York, 14 in Cape Town and 17 in Sao Paulo. A true north that is 15 degrees wrong is worse than no true north, because it is wrong quietly and carries the authority of a computed number.
So the compass has a field for it instead. Get the figure for your position from NOAA once, paste it in, and true north becomes available. Your location is still used for your coordinates and for the qibla, both of which are exact spherical trigonometry rather than a model of the earth's field.
Questions
The compass rose
Why are there 32 points?
Because the rose is built by repeated halving. Start with the four cardinals, halve to get the four ordinals, halve again for the eight half-winds, and once more for the sixteen quarter-winds. Four orders of subdivision gives thirty-two points at 11.25 degrees each.
You can keep going, and mariners did: a full card could be divided into sixty-four or even one hundred and twenty-eight points. Thirty-two is where it stopped being useful to name them.
What does "northeast by north" mean?
It means one quarter-point from northeast, in the direction of north. It is 33.75 degrees. The word "by" always signals a quarter-wind, and the point named first is the one you start from.
These are the sixteen names most people have never needed. Everything from a weather forecast to a phone compass rounds to the sixteen-point rose instead, which is why this site reports a sixteen-point name in the readout and keeps all thirty-two on the card.
Why is a bearing written as 007 and not 7?
Three digits, always, so that a heading can never be mistaken for anything else being spoken or written alongside it: a distance, a channel, a runway number. It is a convention from aviation and marine radio and it exists purely to remove ambiguity.
Questions
Privacy and cost
Is my location sent anywhere?
No. The declination is calculated in your browser, so your coordinates never leave the device. They are held in the page while the tab is open and discarded when you close it.
Do I need to install anything, or sign up?
No. It is a web page. There is no app, no account and no paywall, and it works offline once loaded because the whole rose is drawn in the page rather than fetched.
Next