Qibla Direction

Use your location or choose your city to find the Qibla angle; on mobile, turn your phone until the golden arrow lights up.

NESW

Tap "Enable compass" on mobile to rotate the compass with your phone's direction

The Qibla direction: the religious ruling and how it is determined

Facing the Qibla is one of the conditions for the validity of prayer, by agreement of the scholars, for whoever is able to do so. The Qibla is the Holy Kaaba in al-Masjid al-Haram in Makkah. At first the Muslims prayed towards Bayt al-Maqdis (Jerusalem); then Allah the Exalted commanded His Prophet ﷺ to turn towards the Kaaba, saying, glorified be He:

﴿قَدْ نَرَىٰ تَقَلُّبَ وَجْهِكَ فِي السَّمَاءِ ۖ فَلَنُوَلِّيَنَّكَ قِبْلَةً تَرْضَاهَا ۚ فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ ۚ وَحَيْثُ مَا كُنتُمْ فَوَلُّوا وُجُوهَكُمْ شَطْرَهُ﴾“We have certainly seen the turning of your face, [O Muhammad], toward the heaven, and We will surely turn you to a qiblah with which you will be pleased. So turn your face toward al-Masjid al-Haram. And wherever you [believers] are, turn your faces toward it.”Surah Al-Baqarah: 144

The change of the Qibla took place in the second year after the Hijrah according to the well-known view, after about sixteen or seventeen months of praying towards Bayt al-Maqdis. This tool helps you find the Qibla direction accurately from anywhere in the world, with an explanation of the scientific basis of the calculation, ways of verifying it, and the rulings on exercising judgement about it.

How is the Qibla direction calculated?

The earth is approximately spherical, so the shortest path between two points on its surface is not a straight line on a flat map, but an arc of a great circle, a circle whose plane passes through the centre of the earth. The Qibla direction is the angle this arc makes with true (geographic) north at the place where the person praying stands, measured clockwise from north.

The calculation depends on two things:

Then the formula for the initial bearing on a sphere is applied using spherical trigonometry, producing a number in degrees, such as 135 degrees, meaning the Qibla is to the southeast. For this reason the Qibla direction in some countries may seem different from what one would expect from looking at a flat map; in North America, for example, the Qibla is towards the northeast, not the southeast, because the great-circle arc is the shortest.

The tool also shows the approximate distance between you and the Kaaba in kilometres, calculated along the same path.

Using the compass on your phone

Most smartphones contain a magnetic sensor that works as a compass, so the tool shows an arrow pointing directly to the Qibla as you turn the phone. To get a correct reading, pay attention to the following:

Magnetic north and true north

The compass points to magnetic north, a location that changes slowly over time and does not coincide with true north (the real North Pole, from which the Qibla direction is calculated). The difference between them is called magnetic declination, and it varies from place to place: it may be a degree or two in some countries and more than ten degrees in others. Many phones correct for this declination automatically when location services are enabled, so you should allow this to get the most accurate result.

If your device has no compass sensor, the tool will display the Qibla angle in degrees, and you can use a map or the sun method to determine it.

Finding the Qibla using the sun

One of the most accurate and simplest methods is to determine the Qibla using the phenomenon of the sun being directly overhead the Kaaba. The sun passes almost directly above the Kaaba twice a year: around 28 May at about 12:18 noon Makkah time, and around 16 July at about 12:27 noon Makkah time, with slight variations from year to year. At that moment, in countries where the sun is above the horizon, the shadow of any vertical pole points exactly opposite to the direction of the Qibla, so the direction towards the sun is the direction of the Qibla.

To apply this: convert the stated time to your local time, then set up a stick or a string with a weight hanging from it on level ground, and at the specified time draw a line along the shadow; the direction from the tip of the shadow towards the stick is the Qibla direction. This method works in countries where the sun is visible above the horizon at that moment, such as most of Africa, Europe, the Middle East and Western Asia.

The ruling on exercising judgement about the Qibla and slight error

The jurists distinguish between someone who can see the Kaaba with his own eyes and someone who is far from it: the one nearby who can see it must face the Kaaba itself, whereas for the one far away, the majority hold that what is required is to face its direction, not the Kaaba itself, because facing the Kaaba itself with certainty is impossible for someone far away. They cite as evidence the saying of the Prophet ﷺ to the people of Madinah:

"What is between the east and the west is a Qibla."Narrated by al-Tirmidhi and Ibn Majah

According to the scholars, this means that for those whose Qibla is to the south, like the people of Madinah, everything between east and west is a direction for them. It follows that a slight deviation from the calculated direction does no harm, and the person praying is not required to fix the degrees with extreme precision; rather, he strives to face the direction using the means available to him.

Whoever strives to determine the Qibla, prays, and then discovers after the prayer that he was mistaken, his prayer is valid according to the majority of scholars and he does not need to repeat it, because he did what he could, and Allah the Exalted says:

﴿فَاتَّقُوا اللَّهَ مَا اسْتَطَعْتُمْ﴾“So fear Allah as much as you are able.”Surah At-Taghabun: 16

If he discovers the mistake during the prayer, he turns towards the Qibla and completes his prayer, as the people of Quba did when news of the change of the Qibla reached them while they were praying, and they turned towards the Kaaba; the hadith is in the two Sahihs.

Where there is the mihrab of a recognised mosque in the country, the basic rule is to rely on it, and one should not abandon the Qibla of established mosques merely because of a slight difference shown by an electronic tool that may be affected by metals or poor calibration.

How to use the tool

  1. Allow the browser to access your location, or choose your city manually.
  2. The Qibla angle in degrees from true north will appear, along with the distance to Makkah.
  3. On a phone, allow access to the orientation sensor, then hold the device horizontally and turn until the arrow lines up with the Qibla mark.

After determining the Qibla, find the prayer times in your city.

Frequently Asked Questions

What coordinates of the Kaaba are used in the calculation?

The tool uses a latitude of approximately 21.4225 north and a longitude of approximately 39.8262 east.

Why does the Qibla point to the northeast in America?

Because the calculation relies on the shortest path on the surface of the spherical earth, which is the great-circle arc, not a straight line on a flat map.

Why does the compass reading on my phone keep changing?

The sensor may need calibrating by moving the phone in a figure-8 motion, or it may be near metals, magnets or electrical devices.

Is the prayer invalid if I deviate slightly from the Qibla?

No; according to the majority, what is required of someone far from the Kaaba is to face its direction, and a slight deviation does no harm.

What is the ruling on someone who prayed by his own judgement and then discovered his mistake?

His prayer is valid according to the majority of scholars and he does not need to repeat it if he made an effort; if he learns of the mistake during the prayer, he turns and completes it.

When is the sun directly overhead the Kaaba?

Twice a year approximately: around 28 May and 16 July near noon Makkah time; at that moment the direction towards the sun is the direction of the Qibla.