Qibla direction, from where you are

OIOA works out the Qibla as the great-circle bearing from your location to the Kaaba in Makkah, on your phone, even offline.

What the Qibla is

The Qibla is the direction of the Kaaba in Makkah, which Muslims face in prayer. From India, the Qibla points roughly west. The exact direction depends on where you are, and it changes noticeably between, say, Srinagar, Kolkata and Kochi.

How OIOA finds it

The Earth is round, so the shortest path between two places is not a straight line on a flat map but a great circle, like the route an aircraft flies. The Qibla is the direction in which that shortest path starts from your location, measured as a bearing clockwise from true north.

Diagram: a compass circle with true north and a line toward the Qibla, showing the bearing measured clockwise from north.
Qibla is a great-circle bearing from your location.
Text version of this diagram

The Qibla direction is the starting bearing of the shortest path over the Earth’s surface (a great circle) from your location to the Kaaba in Makkah. It is measured clockwise from true north and worked out with spherical trigonometry from two pairs of latitude and longitude. From most of India it points roughly west.

OIOA calculates this bearing on your phone from two pairs of coordinates: your latitude and longitude, and the Kaaba’s. The calculation uses standard spherical trigonometry and takes a fraction of a second, so the Qibla direction works offline, wherever you are.

Because the shortest path follows the curve of the Earth, the Qibla from India is a little different from the direction you’d get by drawing a straight line on a flat map. The great-circle method is the one used by most Qibla calculators.

From true north to your phone

Your phone’s compass measures magnetic north, which differs from true north by an amount called magnetic declination. Across India this difference is small, around a degree or two, and phones typically correct for it automatically using your location.

The bigger source of error is usually the compass itself.

Getting an accurate reading

  1. Calibrate the compass. Many phones ask you to move the phone in a figure-of-eight; do this if prompted, or if the direction seems unstable.
  2. Move away from metal and magnets. Steel tables, railings, cars, speakers, magnetic phone cases and mounts can pull the compass off by many degrees.
  3. Hold the phone flat and away from your body.
  4. Check against a landmark if you can. If you know your mosque’s mihrab or the Qibla direction of a nearby mosque, compare.
  5. Try again outdoors if a reading indoors seems off.

When you travel

On a journey, open OIOA where you are and the Qibla updates for your new location. If you’ve chosen a city rather than using your phone’s location, remember to change it.

For mosques and homes

When setting the Qibla for a new building, prayer room or home, many communities consult their local mosque or a scholar, and some use a more precise survey. OIOA’s direction is a reliable guide for daily use; for permanent construction, please follow your community’s established practice.

Learn more

If the Qibla in OIOA seems wrong for your location after calibrating your compass, please tell us what we missed with your city and the direction you expected.

Bring your family, and your calendar, into one app

Family Tree with tithis, shared contacts on every phone, events that ring for everyone, and your community's own calendar, offline. Free, with no paid features.

Android: link coming soonGoogle Play iPhone: link coming soonApp Store

OIOA is for Android and iPhone. Store links appear here as soon as each listing is public.