The qibla is the direction of the Kaaba in Mecca, which every Muslim faces for prayer. From Western Europe it points roughly south-east, but the exact bearing depends on where you stand, and finding it precisely is a beautiful geometry problem that Muslim scholars solved more than a thousand years ago. Here's how to orient yourself reliably, at home or while travelling.
“So from wherever you go out, turn your face toward al-Masjid al-Haram.” — Quran 2:149
A problem of spherical geometry
On a flat map you'd be tempted to draw a straight line to Mecca. But the Earth is a sphere: the shortest path between two points follows the great circle, the arc an aircraft would fly. The qibla is measured along that arc, in degrees from true north, using spherical trigonometry (the same azimuth formula used in air navigation).
This calculation has a prestigious history: as early as the 9th century, scholars such as al-Khwarizmi (whose name gave us the word “algorithm”) and later al-Biruni developed the mathematics needed to determine the qibla of any city. Al-Biruni computed it for Ghazni, in Afghanistan, with remarkable accuracy, with no satellites, just star observations and trigonometric tables. Determining the qibla was one of the driving forces of Islamic astronomy and mathematical geography.
A counter-intuitive consequence of sphericity: from New York or Montreal, the qibla points north-east (~58°), not south-east as a flat map would suggest, because the great circle passes near the North Atlantic. Some reference points:
- Paris: about 119° (south-east)
- London: about 119°
- New York: about 58° (north-east)
- Jakarta: about 295° (west-north-west)
Method 1: your phone's compass (and the magnetic north trap)
The most convenient method, provided you know what a compass actually measures. It doesn't point to true north (the Earth's rotation axis) but to magnetic north, which deviates from it by an angle called magnetic declination, varying with location and… the year, since the magnetic pole drifts by tens of kilometres annually. In Western Europe the declination is small (±2°), but in Canada or Siberia it can exceed 15°. Good apps correct for it automatically using geomagnetic models.
For a reliable reading:
- Calibrate the compass by drawing a figure “8” with the phone when the app asks: this lets the sensor recalibrate.
- Keep magnets away: MagSafe cases, magnetic car mounts, laptops, speakers: any nearby magnetic field skews the magnetometer.
- Hold the phone flat, away from metal masses (radiators, beams, cars).
- Check twice, from two different spots in the room: if the arrow agrees, it's trustworthy.
Method 2: the sun, the most accurate (no app at all)
At every instant there is one point on Earth where the sun sits exactly overhead: the subsolar point. And that point passes exactly over the Kaaba twice a year: around May 27–28 and July 15–16, at 12:18 pm Mecca time (9:18 UTC). At that precise moment, wherever you are on the sunlit side of the Earth, facing the sun means facing the qibla. The shadow of any vertical object then points exactly away from Mecca.
It's the most accurate method there is: no sensor, no interference, pure geometry. Note the direction that day (a mark on the floor, a wall corner) and you have a verified reference for the whole year. The rest of the time, the sun remains a good rough landmark: rising in the east, setting in the west.
Method 3: landmarks around you
- The mihrab of a nearby mosque shows a locally verified qibla, often to the degree.
- In hotels across Muslim countries, look for the qibla sticker on the ceiling or in a drawer.
- At home, once you've found the direction, memorise a fixed landmark (a window, a wall corner, a floorboard pattern): no need to search again every day.
Do you need degree-perfect accuracy?
No, and this is a reassuring point of fiqh. The obligation is to face the general direction of the Kaaba (jihat al-Kaaba), not to aim at the building to the exact degree: from 5,000 km away, a few degrees of error are religiously inconsequential. A hadith even states: “What is between the east and the west is a qibla” (Tirmidhi), said for Medina, where the Kaaba lies due south. A sincere, reasonably accurate orientation is enough, especially when travelling or in doubt.
Qibla in Deenius
Deenius solves the great-circle calculation locally on your iPhone, from your position and the Kaaba's coordinates (21.4225° N, 39.8262° E), with magnetic declination correction, without sending any data to a server. The compass works fully offline, on a plane or on a hike.