Prayer · Zenith
How to find the Qibla direction from anywhere
The Qibla is the direction of the Kaaba in Makkah, most commonly calculated as the great-circle bearing from your location to the Kaaba's coordinates, about 21.42 N and 39.83 E, measured from true north. A phone can compute it from your position. On 27 or 28 May and 15 or 16 July, the sun itself points to it.
What the Qibla direction means in calculation terms
The Qibla is the direction toward the Kaaba that Muslims face in prayer. To turn that into a number, you need a definition of direction on a round Earth. According to the Wikipedia article on the Qibla, the most common technical definition used by Muslim astronomers is the great circle passing through your location and the Kaaba, which is the shortest path between the two points on the globe.
A minority uses a different line, the rhumb line or loxodrome, which keeps a constant compass heading all the way. Near Makkah the two methods give similar answers. Far away they can differ a lot. By our calculation from the Kaaba's coordinates, Cairo gets 136 degrees by great circle and 138 by rhumb line, while New York gets about 58 degrees, northeast, by great circle and about 101 degrees, east-southeast, by rhumb line.
That gap is the root of a long debate in North America. Wikipedia records that S. Kamal Abdali argued for the great-circle northeast direction in 1978, that Riad Nachef and Samir Kadi argued for the southeast in 1993, and that most North American Muslims came to follow the northeast with a minority following the east or southeast. This guide explains how each number is produced. Which convention your community follows is a question for your local mosque.
How the bearing is calculated
Every Qibla calculator works from two pairs of coordinates: yours and the Kaaba's. Wikipedia gives the Kaaba's position as 21.422478 degrees north and 39.825183 degrees east. The great-circle formula from spherical trigonometry turns those four numbers into an initial bearing, an angle measured clockwise from true north.
Some results, calculated with that formula and rounded: London about 119 degrees, which is southeast; Istanbul about 152 degrees; Karachi about 268 degrees, almost due west; Jakarta about 295 degrees; Los Angeles about 24 degrees; and New York about 58 degrees. The London, Istanbul and Karachi figures match those published by Masjidbox.
Because the answer depends on your exact coordinates, it is not constant across a country. Los Angeles and New York are both in the United States, yet their great-circle bearings differ by more than 30 degrees.
Why a straight line on a flat map misleads
The Wikipedia article on the Mercator projection explains that it draws rhumb lines, paths of constant compass bearing, as straight lines, and that major online map services such as Google Maps, Bing Maps and OpenStreetMap use a variant of it called Web Mercator. Draw a ruler line from New York to Makkah on such a map and it heads east-southeast, around 101 degrees. The great-circle route instead leaves New York toward the northeast and curves across the Atlantic.
If you want to check a direction on a map, use a tool that draws the shortest path over the globe rather than a straight line across a flat projection, and know which of the two definitions your community uses.
Using a phone compass without being misled
A calculated bearing is measured from true north, the direction of the geographic pole. A magnetic compass points to magnetic north. The U.S. National Oceanic and Atmospheric Administration defines magnetic declination as the angle between the two and notes that it changes with location and over time. The Wikipedia article on the Qibla notes that it can measure up to 20 degrees. A Qibla app should correct for it. With a plain compass, you have to add or subtract the local declination yourself.
Phone compasses are also sensitive to their surroundings. Apple's iPhone user guide states that the compass can be affected by magnetic or environmental interference and should be used only for basic navigation assistance. Google's help for Maps on Android recommends calibrating by moving the phone in a figure 8 until the direction beam narrows.
In practice, calibrate before you rely on the reading, hold the phone flat, and step away from steel furniture, car interiors, speakers and magnetic cases or mounts. If two methods disagree by a wide margin, trust neither until you have found out why.
An app can handle the declination step for you. Zenith's Qibla tab, for example, shows the bearing to Makkah as a number, corrects for magnetic declination, and glows gold when the phone is lined up. On a phone without a magnetometer the needle stays fixed, so there the number is the part to use, checked against another reference.
The sun method: two days a year
Twice a year the sun passes directly over the Kaaba. Wikipedia gives the times as 27 or 28 May at about 12:18 Saudi Arabia Standard Time, which is 09:18 UTC, and 15 or 16 July at about 12:27 Saudi time, 09:27 UTC. At that moment, anywhere the sun is above the horizon, facing the sun means facing the Kaaba.
The simplest way to use it is a vertical stick or any upright edge. At the exact minute, the shadow points directly away from the Kaaba, so the line from the tip of the shadow to the base of the stick points toward it. Mark that line on the ground or a windowsill and you have a reference that needs no compass.
Convert the time carefully. In London during British Summer Time the moments fall at 10:18 and 10:27. In Los Angeles on Pacific Daylight Time they fall at 02:18 and 02:27, in the middle of the night, so the method is not available there.
Common mistakes
Reading a true bearing against magnetic north. If your compass shows magnetic north and you have not applied the declination, the direction can be off by many degrees. Calibrating in a car or on a metal desk adds a second error on top.
Using a ruler on a flat map. On a Mercator-style map this gives a rhumb line, which can differ from the great-circle bearing by tens of degrees far from Makkah, as the New York example shows.
Getting the sun time wrong. The published times are in Saudi time or UTC. Forgetting daylight saving time moves your reading by an hour, when the sun is somewhere else in the sky entirely.
This guide covers how the direction is computed and measured. Questions about how precisely one must face the Qibla, or which convention a community follows, belong with a scholar or imam you trust.
Frequently asked questions
Why does my app point a different way from an older mosque
The two may use different definitions. Most calculators use the great-circle bearing, while some older mosques in places far from Makkah were aligned by the rhumb line or by a map. The mosque can tell you which convention it follows.
Is the Qibla from North America northeast or southeast
The great-circle calculation gives northeast, about 58 degrees from New York. The rhumb-line method gives east-southeast, about 101 degrees. Wikipedia records that most North American Muslims follow the northeast direction and a minority the east or southeast. Ask your local mosque which it uses.
Does the Qibla direction change over time
The calculated bearing from a fixed spot does not change. Magnetic declination does, according to NOAA, so a direction marked with a magnetic compass years ago may need a fresh check.
Can I find the Qibla without an internet connection
Yes. The bearing needs only your coordinates and the Kaaba's, so it can be calculated on the device, and the sun method needs nothing but the correct time.