Qibla Finder: How to Find the Direction of the Kaaba (2026)

Every Muslim faces the Kaaba in Mecca during salah. Getting the direction right matters — it’s part of the prayer’s validity. The tool below uses your location to calculate the qibla bearing in degrees, and on mobile, it can use your device’s compass to point in real-time. There’s a free qibla finder underneath and an explanation of how the calculation works.

→ Jump to qibla finder

What Is the Qibla?

The qibla is the direction Muslims face during prayer — toward the Kaaba in Mecca, Saudi Arabia (coordinates: 21.4225°N, 39.8262°E). It’s a religious obligation in salah, established in the Qur’an:

“So turn your face toward al-Masjid al-Haram. And wherever you [believers] are, turn your faces toward it.” (Surah Al-Baqarah 2:144)

The qibla is a single point on Earth, so the direction to face it depends entirely on where you’re standing. From New York, it’s roughly northeast. From Jakarta, west-northwest. From Dhaka, west. From Tokyo, west-southwest.

How the Qibla Direction Is Calculated

Two methods exist, and they sometimes disagree.

1. Great-circle (initial bearing) method

This is the standard method used by virtually all modern qibla apps and websites, including this tool. It calculates the initial compass bearing you’d follow if you were walking the shortest distance to the Kaaba along the Earth’s surface.

For most cities, this gives results that match traditional qibla orientations of historic mosques. The formula uses spherical trigonometry on the Earth’s coordinates.

2. Rhumb line (constant bearing) method

An alternative method that calculates the direction you’d follow if you maintained a constant compass heading all the way to the Kaaba. This produces a different result from great-circle for most locations, especially those far from the equator.

Some classical scholars debated which method is more correct. The great-circle method is now the consensus among modern authorities and is what nearly all apps use.

The math (briefly)

Given your latitude/longitude and the Kaaba’s:

  • Calculate the difference in longitude between you and the Kaaba.
  • Use the standard spherical-trigonometry initial-bearing formula.
  • The result is your qibla bearing, expressed as an angle from true north (0° = north, 90° = east, 180° = south, 270° = west).

The tool below shows you this angle in degrees, plus the equivalent compass cardinal direction (e.g., “WSW” for 245°).

Use the Qibla Finder

Allow location access (or enter your coordinates manually) and the tool will calculate your qibla bearing and the distance to the Kaaba in kilometers.

On mobile devices, the tool can also use your device’s compass to display a live needle that points toward the Kaaba — useful when you want to verify your orientation in real-time. Hold the phone flat for best results.

Qibla Finder

Find the direction of the Kaaba from your location

Use your device's location to compute the qibla direction. Your browser will ask for permission.

Enter your latitude and longitude. You can find these in any maps app.

Note: The qibla direction is calculated using the great-circle bearing from your location to the Kaaba (21.4225°N, 39.8262°E). Device compasses can be affected by nearby metal, magnets, or magnetic interference — for critical use (e.g. orienting a mosque), confirm with multiple sources.

Approximate Qibla Bearings from Major Cities

For reference (calculated using great-circle method):

  • Dhaka, Bangladesh: ~277° (west)
  • Karachi, Pakistan: ~268° (west)
  • Mumbai, India: ~280° (west)
  • Hyderabad, India: ~277° (west)
  • Dubai, UAE: ~258° (west-southwest)
  • Riyadh, Saudi Arabia: ~260° (west-southwest)
  • Cairo, Egypt: ~136° (southeast)
  • Istanbul, Turkey: ~152° (southeast)
  • London, UK: ~119° (east-southeast)
  • New York, USA: ~58° (east-northeast)
  • Toronto, Canada: ~55° (east-northeast)
  • Jakarta, Indonesia: ~295° (west-northwest)
  • Kuala Lumpur, Malaysia: ~293° (west-northwest)
  • Tokyo, Japan: ~293° (west-northwest)
  • Sydney, Australia: ~278° (west)

If you’re in one of these cities, you can use the listed bearing directly with any standard compass. Otherwise, use the tool above for an exact calculation.

How to Actually Face the Qibla

Three common approaches:

1. In a mosque

Mosques have a mihrab — a niche in the wall facing the qibla — and the rows for prayer face that direction. Just align yourself with the rows. No calculation needed.

2. Using a compass

Get your qibla bearing in degrees from the tool above. Then use a compass — physical or digital — to rotate yourself until the compass shows that heading. The direction you’re facing is the qibla.

Be aware: most compasses show magnetic north, not true north. The difference (called magnetic declination) varies by location — in some places it’s negligible (a few degrees), in others it’s significant (10°+ in parts of North America and Australia). Quality qibla apps and most modern phones account for this automatically; standalone analog compasses don’t.

3. Using a phone’s compass

On mobile devices, the built-in compass uses GPS plus magnetometer data, and most qibla apps (including the tool above on mobile) account for magnetic declination automatically. Hold the phone flat (not tilted) for best accuracy.

Calibrate your phone’s compass occasionally by rotating it in a figure-8 motion. Devices accumulate drift, especially near metal or magnetic interference.

Common Sources of Inaccuracy

  • Magnetic interference. Phones, watches, refrigerators, cars, metal furniture, and steel-frame buildings can throw off compass readings by 10–30 degrees. Step away from these when checking direction.
  • Phone tilt. Most phone compasses work best when held flat. Tilting changes the magnetometer reading and can give incorrect bearings.
  • Compass not calibrated. Phones need occasional figure-8 calibration. Settings → Compass → calibrate (or wait for the app to prompt).
  • Confusing true north with magnetic north. Older analog compasses point to magnetic north. The qibla bearing is calculated from true north. Apply your local magnetic declination to convert, or use a digital compass that does this automatically.
  • Inaccurate location. If your GPS or manual entry is off by a few kilometers, the qibla bearing is usually still essentially correct (the Kaaba is far away enough that small location errors don’t matter much). But entering a wrong city manually can give significantly wrong results.

When You Can’t Determine the Qibla Exactly

Sometimes you can’t be precise — you’re in an unfamiliar place, your devices fail, or you’re in a closed space with no clear direction reference. Scholarly guidance:

  • Make your best effort (ijtihad). Use whatever information you have — direction of the sun’s position, where you came from, asking locals, looking for a nearby mosque’s orientation.
  • Pray with sincere intention. If you’ve made a reasonable effort and pray in good faith, your prayer is valid even if your direction turns out slightly off. The Prophet ﷺ accepted prayers from people who later discovered they’d been facing slightly off.
  • Repeat if needed. If you realize during the prayer that you’re significantly off, you can correct your direction without invalidating the prayer (most scholars). If you finish and then realize you were significantly wrong, most schools say no repetition is needed if you made sincere effort; some require it for major errors.

Special Situations

On an airplane

You don’t need to track the qibla precisely while flying. Face the direction of travel for prayer (typically forward in the cabin). Once you land, resume normal qibla orientation.

On a ship or moving vehicle

Same principle as airplanes. Face whatever direction you can; the obligation to face exactly toward the Kaaba is waived during travel.

Praying in Mecca

Inside the Masjid al-Haram, the qibla is the Kaaba itself, which is in front of you regardless of where you stand around it. The rows of pilgrims form concentric circles facing the Kaaba.

Far from any mosque or modern device

Use the sun: in the Northern Hemisphere, the sun is roughly south at solar noon. Adjust from there based on your approximate qibla direction. This is imprecise but better than nothing.

Sources and Scholarly Notes

This guide draws on:

  • The Qur’an, particularly Surah Al-Baqarah (2:144, 2:149-150) on facing the Kaaba in prayer.
  • Sahih al-Bukhari and Sahih Muslim for hadith on the qibla direction and prayers during travel.
  • The great-circle bearing formula from spherical geometry, standard in all modern qibla calculations.
  • Multiple madhab traditions on the obligation of facing the qibla and the conditions under which the obligation is reduced (travel, illness, prayer at sea).

For your personal situation — especially involving prayer in unusual locations, ships, airplanes, or locations where direction is uncertain — consult a qualified scholar.

Disclaimer: Calculated qibla bearings are mathematically precise. Compass-based real-world direction-finding can be affected by magnetic interference and calibration. For critical use (e.g., orienting a new mosque), verify with multiple methods and consult professionals.

Related Tools

Frequently Asked Questions

Q: What direction is the qibla from my city?
A: Use the qibla finder tool above with your location enabled. It will give you the exact bearing in degrees and the corresponding compass direction (NE, SW, etc.). Common cities are listed in the Approximate Qibla Bearings section above.

Q: Why does the qibla direction differ from what some traditional sources say?
A: Older sources sometimes used the rhumb line (constant bearing) method, which gives different results from the great-circle (initial bearing) method used by modern apps. The great-circle method is now the consensus standard, and modern mosques are typically oriented according to it.

Q: Does my phone’s compass need calibration?
A: Yes, occasionally. Calibrate by moving the phone in a figure-8 motion. Magnetic interference, metal objects, and dropped phones can throw off the magnetometer. Calibrate before relying on the compass for prayer.

Q: What if my compass shows a slightly different direction than this tool?
A: Most likely your physical compass shows magnetic north, while the qibla bearing is calculated from true north. The difference (magnetic declination) varies by location — in some places it’s 10+ degrees. Quality qibla apps account for this; analog compasses don’t.

Q: What if I face the wrong direction during prayer by mistake?
A: If you realize during the prayer, correct your direction and continue (most madhabs allow this). If you realize after finishing, and you made sincere effort to find the qibla, your prayer is generally accepted as valid. The Prophet ﷺ accepted prayers from people who later discovered they’d been slightly off.

Q: How do I find the qibla when traveling in unfamiliar places?
A: Use a qibla app or web tool with your GPS location. Hotel rooms often have a qibla direction marker on the ceiling or wall — common in Muslim-majority countries. Mosques are also a clear visual reference; their orientation is set correctly.

Q: Does my prayer count if I’m not facing exactly the qibla?
A: If you made sincere effort to determine the qibla, yes. The obligation is to face the qibla to the best of your ability, not to be perfectly accurate to the degree. Minor deviation doesn’t invalidate the prayer.

Q: Why is the qibla different in different countries?
A: Because the Kaaba is a single point on Earth. From every other location, the direction to that point is different. From east of the Kaaba (most of Asia), the qibla is roughly westward. From west of the Kaaba (the Americas, Europe), it’s roughly eastward.