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.

Share this tool:

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.
No. All calculations happen entirely inside your browser. Your coordinates are never sent to any server, stored in a database, or shared with third parties. This tool is 100% private.
Your GPS coordinates are the only input needed to calculate the Qibla angle and distance. Without location access the tool cannot function. You can deny permission — the tool will show an error and ask you to try again.
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.

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools