Bearing to the Kaaba in Makkah, from wherever you are. Pick your city for a live compass and the exact angle from true north. A gentle haptic tap confirms alignment.
The qibla is the direction every Muslim faces in prayer. It points to the Kaaba, the cube-shaped structure at the centre of the Sacred Mosque in Makkah, at 21.4225° N, 39.8262° E. Facing it during the five daily prayers is one of the validity conditions of salah whenever it can reasonably be determined, which on a modern phone takes about a second.
For the first sixteen or seventeen months after the Hijrah, Muslims prayed facing Bayt al-Maqdis in Jerusalem. The change to the Kaaba was revealed in Surah al-Baqarah while the Prophet ﷺ was leading the Dhuhr prayer in Madinah. The community literally turned mid-prayer. The mosque where it happened is preserved today as Masjid al-Qiblatayn, the Mosque of the Two Qiblas, and you can still see the original mihrab that pointed north towards Jerusalem alongside the current one that points south towards Makkah.
The shortest path between any two points on a sphere is called a great circle. It is the line a tight string would trace if you pulled it taut across a globe. For prayer, the qibla is the initial bearing of the great circle from your location to the Kaaba, measured in degrees clockwise from true north. Zero degrees is due north, ninety is east, one-eighty is south, two-seventy is west.
This is why the bearing changes more than you might expect as you travel. From London the qibla is roughly 119° (south of east). From New York it is 58° (north of east), not east, and not south. The shortest path from New York to Makkah goes up over Greenland and back down across Europe, because the planet is round. From Tokyo the qibla is 293° (north of west), again because the shortest path skims the Arctic.
The maths is the same one airlines use to plan flight routes. We use the adhan calculation library on the server and on the phone, which is the same library used by many established prayer apps, so a bearing from us should match a bearing from them to within a few hundredths of a degree.
Every qibla bearing on this site is from true north, the geographic pole at the top of the earth. A magnetic compass points at magnetic north, a point currently in the Canadian Arctic that drifts roughly forty kilometres per year. The angle between the two is called magnetic declination, and it depends on where you are.
In London the declination is about zero, so a magnetic compass and a true-north compass agree. In Vancouver it is fifteen degrees east. In Cape Town it is twenty-five degrees west. If you have a physical compass and a qibla bearing from true north, you need to subtract the local declination to know which way to actually turn. Phones running this app handle the conversion automatically (iOS exposes both heading values, we use the true-north one), so the arrow on the screen points where you need to face without you doing the maths.
If your phone compass disagrees with us by a few degrees, the most common cause is interference. Magnets in phone cases, laptops, headphones, or even reinforced concrete in walls can pull the needle several degrees off. Step outside, away from metal, and the readings usually converge.
Determining the qibla precisely from any point on earth is a problem in spherical trigonometry, and the Muslim world solved it centuries before the rest. Al-Biruni (973 to 1048 CE) calculated qibla bearings for cities across the Islamic world using methods that match modern computation to within a fraction of a degree. The astrolabe, refined by Muslim scientists, doubled as a qibla finder. Some mosques in old Cairo are aligned to bearings that astonish modern surveyors for how accurate they are given the equipment of the time.
Until smartphones, the standard tools were a printed table of cities and their bearings, the sun (the Kaaba is directly under the sun twice a year, on roughly 28 May and 16 July, when the shadow of any vertical object points away from Makkah at noon), and the qibla compass, a flat compass with the bearing for the user's home city pre-marked. What we are doing here is making the same calculation available for anywhere on earth, from a phone, in under a second.
The qibla is the direction Muslims face during the five daily prayers. It points to the Kaaba in Makkah, the cube-shaped structure at the centre of the Sacred Mosque. Allah commanded the change of qibla to the Kaaba in Surah al-Baqarah (2:144), and facing it correctly is one of the conditions for a valid prayer when it is reasonable to determine.
We use the great-circle (shortest-path) formula on a spherical earth model. Given your latitude and longitude, and the Kaaba at 21.4225° N, 39.8262° E, the formula returns an angle measured clockwise from true north. The same maths airlines use for flight paths, which is why a plane from New York to Tokyo flies over the Arctic rather than the Pacific.
Most compass apps return magnetic north by default. Magnetic north is offset from true (geographic) north by an amount called magnetic declination, which varies by location and drifts over years. Our bearing is always given from true north. If you are using a physical compass, look up your local declination and adjust, or use a phone app that compensates for it automatically.
Three reasons. First, the earth is not a perfect sphere, so apps that use the WGS-84 ellipsoid get slightly different answers than spherical-earth apps (the difference is usually under half a degree). Second, some apps still apply magnetic declination when they shouldn't, or vice versa. Third, a handful of older apps use a rhumb-line (constant compass heading) instead of the great-circle path, which can be off by tens of degrees for cities far from Makkah.
No. For the first sixteen or seventeen months after the Hijrah, Muslims prayed facing Bayt al-Maqdis in Jerusalem. The change to the Kaaba was revealed in Surah al-Baqarah while the Prophet ﷺ was leading the noon prayer. The mosque where it happened is known as Masjid al-Qiblatayn (the Mosque of the Two Qiblas) in Madinah.
Make your best estimate using the sun's position, the stars, or by asking. The prayer is valid if you tried sincerely and were wrong, per the hadith in Tirmidhi about a group who prayed in the wrong direction on a cloudy night and were not asked to repeat. Our app removes the ambiguity, but the principle of effort over precision is the underlying rule.