Apps

How to find the Qibla with your phone, and when the compass lies

Alazka Technologies · 2026-10-12

A Qibla app does two very different jobs. The first is maths it will always get right. The second depends on a tiny magnetic sensor that is easily confused. Knowing which is which tells you when to trust the arrow.

The part the app always gets right

The direction of the Kaaba from any point on Earth is a calculation: given your latitude and longitude and the coordinates of Makkah, the app works out the great-circle bearing. This number is as reliable as your location. If the app knows where you are to within a kilometre, the bearing is correct to a fraction of a degree. You can even type a city name instead of granting location access, and the result is still accurate enough for prayer.

The part that can go wrong

To point an arrow on the screen, the app needs to know which way the phone is facing. That comes from the magnetometer, a sensor that reads the Earth’s magnetic field. It is small, cheap, and sensitive to everything around it:

That is why two phones side by side can disagree, and why the same phone can be right outdoors and wrong in a car park.

Calibrate in ten seconds

  1. Take off a magnetic case if you have one, and step away from metal and electronics.
  2. Move the phone in a figure-of-eight pattern a few times, rotating it through all three axes.
  3. Hold the phone flat, like a tray, and wait for the arrow to settle.
  4. If the app shows a calibration or accuracy indicator, wait until it reports high accuracy before you trust the arrow.

When to trust the mihrab instead

Inside a mosque, the mihrab was set by people who measured carefully, often with a survey. If your phone disagrees with it by a few degrees, the phone is almost certainly wrong, usually because of the building itself. Outdoors in an open space, a freshly calibrated phone is very reliable, and it is the right tool when you are travelling or praying somewhere unfamiliar.

The Qibla compass in Quran Companion works offline, lets you enter a city instead of sharing your location, and shows the bearing in degrees so you can cross-check it against a physical compass or a map.

About the author

Alazka Technologies is an independent Android game studio in Rawalpindi, Pakistan. We make short-session games with fair rules, and a small number of apps including Quran Companion.

Free tools you might need

More notes