Qibla Locator

Find the exact Qibla direction and distance to Makkah from your location.

N
E
S
W

--°

Qibla Direction

from North

--

Distance

to Makkah (km)

Waiting for location...

Live compass off

Hold your phone flat for best accuracy

How does our Qibla Locator work?

The online Qibla Locator uses your device's built-in compass and GPS to calculate the exact direction of the Kaaba in Makkah (Mecca), Saudi Arabia. The browser requests your current latitude and longitude, then applies the Haversine formula and great-circle navigation to compute the shortest path over the Earth's surface and the precise angle from True North.

Whether you're traveling, moving into a new home, or simply want to verify your prayer direction, this tool gives you accurate Qibla readings instantly — no app download required.

GPS Precision

We use the HTML5 Geolocation API to fetch your exact coordinates and display your current city and country via reverse geocoding.

Device Orientation

By leveraging your phone's magnetometer via the DeviceOrientation API, the digital compass turns dynamically with your device. Hold it flat for the best accuracy.

Frequently Asked Questions

The live compass requires your device's built-in magnetometer. Desktop computers do not have one, so the needle will show the fixed Qibla angle from North but will not rotate. On mobile devices, tap "Enable Compass" and grant motion/orientation permission when prompted.
The direction is calculated using the great-circle bearing formula, which is the same method used by professional Islamic apps. Accuracy depends on your GPS precision, but the result is typically within 1–2 degrees.
Distance is computed using the Haversine formula, giving the straight-line great-circle distance over the Earth's surface. The result is extremely precise — usually within a fraction of a kilometre of the actual distance.
The direction and distance are calculated entirely in your browser. The only thing sent anywhere is a lookup to OpenStreetMap's Nominatim service, to turn coordinates into a city name (or a city name into coordinates). Nothing is stored or shared beyond that lookup.
Your GPS coordinates are the only input needed to calculate the Qibla angle and distance. If you deny permission, or your device has no GPS, you can still enter a city name or coordinates manually below the compass.
The compass and direction calculation work offline once the page is loaded. However, the city/country name display requires a connection to the Nominatim geocoding API. The Qibla direction itself is still shown accurately without it.
Yes. Point your phone toward the displayed Qibla angle from North before starting your prayer. For the most reliable result, hold your phone flat and away from metal objects, wallets, or other devices that can interfere with the magnetometer.

Related Faith Tools

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools