Qibla Finder

Find the direction of the Kaaba from wherever you are. The bearing is calculated in your browser, so your location never leaves your device.

Qibla direction

Use your location, or enter coordinates by hand

Compass, no Qibla bearing worked out yet N E S W NE SE SW NW
or enter coordinates

On the map

The line to the Kaaba

The great-circle route drawn over real terrain. It curves, because the shortest path across a sphere is not a straight line on a flat map — which is exactly why the Qibla often points somewhere people do not expect.

Qibla map

Your position, the Kaaba, and the route between them

The rest of this page needs no network. The map does. Loading it fetches Leaflet from a CDN and map images from OpenStreetMap, and each image request names the patch of world you are viewing — so those servers can infer roughly where you are. The compass above keeps working without it.

Getting started

How to use

Three steps, a few seconds, and nothing to install.

STEP 01
Share your location
Tap "Use my location" and allow the browser prompt. Prefer not to? Enter your latitude and longitude by hand instead.
STEP 02
Read the bearing
You get the angle from true north, the nearest compass point, and how far the Kaaba is from you.
STEP 03
Turn to face it
On a phone, enable the live compass and rotate until the needle points straight up. Then double-check against a direction you trust.
Great-circle accuracy
The shortest path over a sphere, not a flat map. See how it is worked out.

Frequently asked

How is the direction calculated?

It is the initial great-circle bearing from your coordinates to the Kaaba at 21.4225°N, 39.8262°E, using the standard forward-azimuth formula with atan2. The result is degrees clockwise from true north.

Why does my phone compass show a different number?

Because most compasses point to magnetic north, not true north, and the gap between them (magnetic declination) varies by location and drifts over time. In some places it is under a degree; in others it is more than 20°. Metal objects, phone cases and speakers distort readings too.

Why does the live compass refuse to turn on my phone?

Because that device is reporting movement without reporting north. Browsers expose two kinds of orientation reading: one measured from magnetic north, and one measured from whatever way the phone happened to be pointing when the page loaded. Only the first is a heading. Firefox on Android never provides the first, and Chrome cannot when the magnetometer is missing or uncalibrated, so rather than spin the dial by a number that means nothing, it stays north-up and tells you. The bearing above is still correct — use it with a separate compass. If it does work but drifts, lay the phone flat: the reading is only a heading while the device is level.

Why not just draw a straight line on a map?

Flat maps distort direction. On a Mercator map the shortest real-world path looks like a curve, so a ruler line gives the wrong bearing — badly wrong over long distances. From North America, for example, the true Qibla is roughly north-east rather than the south-east many people expect.

Is my location sent anywhere?

Not by the compass. There is no server of ours and no analytics: your coordinates are used by JavaScript in the page and discarded when you close it. The only thing stored locally is your light or dark theme preference. Two caveats, both honest ones. The fonts and stylesheet load from public CDNs, which — like any web request — see your IP address. And if you choose to load the map, its images come from OpenStreetMap, and each request identifies the patch of world you are viewing, which narrows down roughly where you are. The map stays unloaded until you press the button.

Can I rely on this for prayer?

The maths is sound and matches published Qibla tables, but the weak links are your device's GPS accuracy and its compass. It is a good practical guide. Where it matters, confirm against your local mosque, a known mihrab, or a direction you already trust.