🧭 Compass

Live device heading · bearing & distance to world cities · manual fallback

Advertisement

An on-screen compass that reads your device’s magnetometer, plus a bearing and great-circle distance to any of 46 world cities — point your phone and the red arrow swings toward, say, Mecca, New York or Tokyo. Everything is computed locally: your location is read by your browser and never sent to us, and the maths runs in the page.

—
—
Tap “Start compass”. On a desktop, drag the dial or use the slider.
Enable the compass (or pick “My location”) to see a live direction and distance.

How a phone compass works — and its honest limits

The needle comes from your device’s magnetometer via the DeviceOrientation API: iOS reports a resolved heading (webkitCompassHeading), Android gives an absolute alpha. It points to magnetic north, not true north — the gap between them is the magnetic declination, which varies by hundreds of kilometres and is not corrected here, so trust the reading to a few degrees, not a hair’s breadth. Calibrate by moving your phone in a figure-8 if it wanders, and keep it flat and away from metal or magnets. A laptop has no magnetometer, so it falls back to the manual dial — which is still a perfectly good protractor for plotting a bearing. The red arrow’s direction to a city is a true-north great-circle initial bearing computed from real coordinates, independent of the sensor, so even on a desktop “My location → Tokyo → 512°” is correct: it is the compass angle you would set off on the geodesic.

Why the destination arrow can be useful

Stand still, set your location, pick a city, and the arrow shows where that city lies relative to the way you are facing — a qibla toward Mecca, the direction home, or which way the next town is on a walk. The distance is the straight-line “as the crow flies” great-circle figure in kilometres and miles, always shorter than any road route (for driving routes see Maps & Navigation).

Part of Everyday Tools. For sunrise/sunset, world clocks and routes, use the neighbouring Maps & Navigation cluster.

Advertisement
Advertisement