Home
Solarc

Qibla direction

Bearing from your location to the Kaaba in Mecca. True-north, great-circle, computed in your device. No signup, no tracking until you accept cookies.

Locating you…

How to use

  1. Open your phone’s compass app. Set it to true north in settings if available.
  2. Hold your phone flat and rotate yourself until the compass needle aligns with the bearing shown above.
  3. You are now facing the Qibla.

If your phone only shows magnetic north, subtract the local magnetic declination (positive for east, negative for west) from the bearing shown above. Declination varies between about −20° and +20° depending on where you are.

Qibla bearing from major Muslim cities

Sorted by distance to the Kaaba. Bearings are degrees from true north (not magnetic).

Qibla direction from major Muslim cities
CityBearingCardinalDistance to Mecca
Mecca
Saudi Arabia
0.0°N0 km
Jeddah
Saudi Arabia
96.0°E66 km
Medina
Saudi Arabia
176.3°S340 km
Riyadh
Saudi Arabia
243.8°WSW790 km
Khartoum
Sudan
48.2°NE1,010 km
Doha
Qatar
252.6°WSW1,269 km
Cairo
Egypt
136.1°SE1,287 km
Baghdad
Iraq
199.8°SSW1,396 km
Dubai
United Arab Emirates
258.2°WSW1,631 km
Tehran
Iran
218.4°SW1,944 km
Istanbul
Türkiye
151.6°SSE2,405 km
Karachi
Pakistan
267.7°W2,800 km
Tunis
Tunisia
112.7°ESE3,328 km
Islamabad
Pakistan
255.9°WSW3,528 km
Lahore
Pakistan
260.4°W3,598 km
Algiers
Algeria
105.4°ESE3,926 km
Casablanca
Morocco
93.7°E4,824 km
Dhaka
Bangladesh
277.6°W5,172 km
Kuala Lumpur
Malaysia
292.5°WNW6,974 km
Jakarta
Indonesia
295.2°WNW7,920 km

Frequently asked questions

What is the Qibla?

The Qibla is the direction Muslims face during prayer. It points toward the Kaaba in Mecca, Saudi Arabia (21.4225° N, 39.8262° E). Mosques worldwide are oriented so that the prayer hall faces the Qibla.

How is the Qibla bearing calculated?

Solarc uses the great-circle initial bearing formula: θ = atan2(sin(Δλ) · cos(φ2), cos(φ1) · sin(φ2) − sin(φ1) · cos(φ2) · cos(Δλ)), where φ are latitudes and λ are longitudes in radians. The result is normalised to 0–360 degrees measured clockwise from true north.

Is this true north or magnetic north?

Solarc returns the bearing in true north (the geographic Qibla). Compasses and phone compass apps measure magnetic north by default, which differs from true north by the local magnetic declination. Most modern phones can be set to true north in their compass app settings.

Why does the Qibla from North America point northeast and not southeast?

Because the Earth is round. The shortest path from New York to Mecca is a great-circle route that goes northeast over the Atlantic, then southeast over Europe. Maps drawn on the Mercator projection make it look like the direction should be southeast, but the great-circle bearing is northeast.

How accurate is this Qibla finder?

The bearing is computed exactly from the spherical-earth model. The Earth is slightly flattened at the poles, so a strict ellipsoidal Qibla can differ from the spherical Qibla by up to about 0.05°. For prayer alignment this is negligible.

Does Solarc store my location?

No. Your coordinates are read in the browser, the bearing is calculated locally, and nothing is sent to a server. No signup is required.