Qibla Direction Finder

Find the Qibla — the direction to the Kaaba in Mecca — from your location as a compass bearing, with a live compass on mobile. Set your location by permission or city search.

How to use

  1. Allow location access or search for your city.
  2. On mobile, follow the live compass as it points toward the Qibla.
  3. On desktop, read the bearing and line it up with a compass.

The Qibla bearing is the initial heading of the great-circle path from your position to the Kaaba on a spherical earth. It is not the straight line you would draw on a flat map, and at high latitudes the two diverge noticeably.

In depth

Qibla is a great-circle bearing, not a compass direction you can guess

The qibla is the direction from where you stand toward the Kaaba in Mecca (21.4225°N, 39.8262°E).

Drawing a straight line on a flat map gives the wrong answer. The Earth is a sphere, so the shortest path is a great circle, and the qibla is that path's initial bearing.

The results are counterintuitive. From New York the qibla points north-east, not south-east — the great circle arcs over the north Atlantic.

From Seoul it points west-north-west, despite Mecca lying to the south-west. Stretch a string across a globe and it becomes obvious.

True north is not what your compass shows

The bearing is calculated from true north (the geographic pole). A magnetic compass points to magnetic north instead.

The difference is called magnetic declination. It varies by location and drifts over time.

It can exceed 20° in some regions. Always apply the local declination when transferring this bearing to a physical compass.

Why phone compasses wander

The magnetometer is sensitive to nearby metal and electromagnetic fields. Reinforced concrete buildings, desk speakers, magnetic phone cases and car interiors all distort it badly.

To recalibrate, hold the device and move it in a figure-eight a few times. Most operating systems recalibrate the sensor when you do.

Readings are most reliable outdoors or near a window, away from metal.

iOS requires permission for compass access, and some Android devices have no magnetometer at all — in which case only the numeric bearing appears.

Finding direction without a compass

At solar noon the shadow points true north in the northern hemisphere, true south in the southern. Measure the qibla angle from that line.

The watch method: point an analogue hour hand at the sun, and halfway between it and 12 is south in the northern hemisphere, outside daylight saving.

Satellite maps work too. Check a building's alignment and use its wall as a reference line, which is surprisingly accurate.

Twice a year, in late May and mid-July, the sun passes directly over the Kaaba. At that moment, facing the sun anywhere on Earth faces the qibla — the most accurate method available and it needs no instrument.

How precise does it need to be

Most scholars hold that the general direction (jihah) suffices at a distance. The further from Mecca, the smaller the practical difference a few degrees makes, and sincere effort is accepted.

Exact orientation (ayn) applies within sight of the Kaaba; direction is the widely accepted standard elsewhere.

Still, checking when you can is worth doing, which is what this tool is for.

Calculation and privacy

The bearing is computed with spherical trigonometry in the browser. No external API is called.

Location comes from device GPS with permission, or from a city search. Your location is not transmitted.

A page already loaded keeps calculating without a connection — useful when travelling without data.

FAQ

How is the Qibla direction found?

It computes the great-circle bearing from your location to the Kaaba (21.42°N, 39.83°E), shown as degrees from true north.

The compass isn't moving.

If your device has no orientation sensor or permission is off, only the bearing is shown. On iOS, tap 'Enable compass' to grant motion access.

How do I use the bearing if I don't have a live compass?

Line up a regular compass to true north, then turn clockwise by the shown number of degrees — that direction is the Qibla.

Is 'Khana Kaaba direction' the same thing?

Yes. Khana Kaaba (the House of the Kaaba) in Urdu and Hindi, kiblat in Malay and Indonesian, kabe in Turkish, and Qibla in Arabic all name the same direction — toward the Kaaba in Mecca. This finder gives that bearing wherever you are.

Method and sources

What this tool bases its numbers on, and how far those numbers go.

What this tool is
A computed bearing shown on a phone sensor. It is an aid for orientation, not a surveyed direction, and a device compass in a building can be tens of degrees out.
Formula
The initial bearing of the great-circle path from your coordinates to the Kaaba (21.4225°N, 39.8262°E), measured clockwise from true north. The live compass adds your device's heading, which the sensor reports relative to magnetic north unless the platform corrects it.
Worked example
From New York (40.7128°N, 74.0060°W) the great-circle bearing to the Kaaba is 58.5° — north-east, not the south-east that a flat rectangular map suggests.
Limitations
  • A phone compass is easily wrong. Steel structures, speakers, magnets, phone cases and lifts all deflect it, and indoors an error of tens of degrees is common. Step outside and away from metal before trusting it.
  • Magnetic north is not true north. The declination between them reaches well over 10° in many populated places, and whether your device corrects for it depends on the platform.
  • The bearing is only as good as your position. A city-level search or a coarse network location can be kilometres off, though at that scale the effect on the bearing is small.
  • A great-circle bearing is not the direction you would draw on a flat map, and it changes as you travel along the path. It is the direction to face from where you are, not a constant heading to follow.
  • It has no orientation sensor to fall back on desktop. There the number is a bearing you must line up with a separate compass yourself.
Effective date
Last reviewed

Related tools