How to find the qibla, and how to tell when your phone is wrong
A compass app will always give you an arrow. Knowing when not to trust it is the part that matters.
Why the direction looks wrong on a map
The qibla is the shortest path along the surface of the Earth to the Kaaba in Makkah — a great-circle bearing. Flat maps distort that badly, which is why the answer often feels wrong at first.
From New York the qibla is roughly north-east, not south-east, even though Makkah is south of New York on the map. From London it is close to south-east. From Jakarta, west and slightly north. The shortest route between two points on a sphere bends towards the pole when drawn on a Mercator projection, and Mercator is the projection almost everyone has in their head.
So if an app points somewhere surprising, that alone is not evidence it is broken. The check below is.
What your phone is really measuring
Two separate things, and both can fail independently.
The first is where you are. Latitude and longitude give the bearing, and that part is pure arithmetic — reliable to a fraction of a degree once the coordinates are right. A stale or coarse location is the quiet failure here: a city-level fix is fine for prayer times and fine for the qibla too, since a few kilometres shifts the bearing by a negligible amount.
The second is which way you are facing, and that is the fragile one. A phone senses direction with a magnetometer — it measures the Earth’s magnetic field. Magnetic north is not true north, and the difference (declination) runs from near zero in parts of Europe to more than fifteen degrees in parts of North America. A compass that reports magnetic heading without correcting for declination points confidently at the wrong place.
Why compasses go wrong indoors
The magnetometer measures whatever field it is sitting in, and a building is full of competing ones. Steel frames and reinforced concrete, radiators, the metal legs of a desk, laptops, speakers, and above all magnets — a magnetic phone case or car mount will swing a compass by tens of degrees and it will not look broken while doing it.
Cars and trains are worse: a steel box moving through the field. A qibla arrow read inside a moving vehicle is close to meaningless.
This is also why a compass can be exactly right in one corner of a room and thirty degrees out in another. If the arrow changes when you walk a few paces holding the phone still, that is interference, not the qibla moving.
Calibrating, properly
Take the phone out of any case with a magnet in it. Move away from metal — a metre or two from radiators, desks and laptops, and out of a car entirely.
Then move the phone in a figure of eight through the air, rotating your wrist as you go, for a few seconds. This is not superstition: it exposes the sensor to the field from several orientations so it can re-solve its own offsets.
Finally, sanity-check it against something you already know. If you know roughly where the sun sets from your window, or which way a street runs, the compass should agree. A compass that disagrees with a fact you are sure of is wrong, no matter how steady the needle looks.
Two ways to find it without a compass
The sun is the reliable one. Twice a year it passes directly over the Kaaba — around 27 or 28 May and around 15 or 16 July, at approximately 12:18 Makkah time. At that moment, anywhere on Earth where the sun is visible, the shadow of any vertical object points exactly away from the Kaaba. Stand a stick up, look along the shadow, and turn around: that is the qibla, with no electronics involved.
The other is other people. A local mosque was aligned by someone who checked carefully, and a prayer mat left out in a room in a Muslim household usually is too. Both are worth more than a phone reading taken next to a fridge.
If you cannot be certain
Face your best estimate and pray. The obligation is to make a reasonable effort to determine the direction, not to achieve surveyor’s precision, and a prayer offered towards a sincere best judgement is not invalidated by a later discovery that it was some degrees off. For the specifics of your situation, ask someone qualified — but do not let uncertainty about the direction become a reason to delay the prayer.
What Mozzi does with all this
It uses the phone’s true heading, which is the magnetic reading already corrected for declination at your location, and falls back to magnetic only when true north is unavailable.
More importantly, it refuses to pretend. iOS grades its own compass confidence, and below a usable grade the uncertainty is wider than thirty-five degrees — enough to point past the Kaaba entirely. At that point Mozzi says it needs calibrating instead of showing a steady arrow, because a confident arrow pointing the wrong way is worse than no arrow at all.
The bearing itself is computed on your device from your coordinates. Nothing is sent anywhere to work out which way you are facing.