Ihsabha
AREN
IhsabhaIslamic Tools › Qibla Direction Finder

🧭 Qibla Direction Finder

Find your exact Qibla direction — the compass bearing toward the Kaaba in Makkah — from any coordinates worldwide, with a live rotating compass, the precise distance to Makkah, and instant offline great-circle geometry that needs no internet connection.

🕌 Prayer Times & Direction
🛡️ Reviewed by: Ihsabha Editorial Team · Method: the great-circle initial-bearing formula and the haversine distance formula from spherical trigonometry, applied to your coordinates and the Kaaba's fixed location — no data ever leaves your browser · Last updated: August 8, 2026
🔒 Privacy note: Everything on this page runs entirely inside your browser using client-side JavaScript. Nothing you type is ever uploaded, logged, or sent to any server.

How to use this tool

  1. Press "Use my current location" to detect your coordinates automatically, or enter your latitude and longitude manually.
  2. Press "Find Qibla Direction".
  3. Read the bearing in degrees from North on the live rotating compass, plus the exact distance to Makkah.
  4. Rotate a physical compass or phone compass app to that heading to face the Kaaba.

Everything runs locally in your browser — no sign-up required, and no data is ever sent anywhere.

About this tool

The Qibla is the fixed compass bearing every Muslim faces during prayer, pointing toward the Kaaba inside the Grand Mosque of Makkah, at coordinates 21.4225°N, 39.8262°E. Because the Earth is a sphere rather than a flat map, the shortest path between two points is a great-circle arc rather than a straight line drawn on a Mercator-style map projection, the same principle airline pilots use to plot the shortest routes between distant cities. This tool applies the great-circle initial-bearing formula from spherical trigonometry to your coordinates, producing a single heading in degrees measured clockwise from true North. It also calculates the great-circle distance to Makkah using the haversine formula, the standard method for measuring distance between two points on a sphere from their latitude and longitude. Because both calculations rely purely on geometry and the coordinates you enter, everything runs instantly inside your browser with no external service, no signal, and no data ever leaving your device. The direction shown is mathematically exact for the coordinates you provide.

Qibla Direction: The Geometry Behind Facing the Kaaba From Anywhere

A surprising number of people assume the Qibla can be found by simply drawing a straight line on a world map from their city to Makkah and reading off the angle. This works only over short distances, because every flat world map distorts either area, distance, or direction to project a curved surface onto a plane. Over the hundreds or thousands of kilometers separating most Muslims from Makkah, that distortion is large enough to point you noticeably off course. The correct approach, used throughout navigation, aviation, and geodesy, is to treat the Earth as the sphere it actually is and calculate the great-circle path, the true shortest route between two points on a globe.

This finder does exactly that. It takes your latitude and longitude, either typed in manually or detected automatically through your device's location service, and applies the great-circle initial-bearing formula to the Kaaba's fixed coordinates. The result appears as a single number in degrees measured clockwise from true North, shown on a live rotating compass so you can see at a glance which way to turn, alongside the exact great-circle distance to Makkah in both kilometers and miles.

One clear advantage of this method over a live prayer-time lookup is that it never depends on an internet connection once the page has loaded. The bearing and distance are pure geometry, computed instantly on your own device from the numbers you provide, so the result stays available on a flight, in a remote area with no signal, or anywhere else a live data service would fail.

A short practical note on using the result: the bearing shown is a true, geographic heading, while most phone compass apps default to magnetic North, which drifts from true North by a varying amount depending on where you are on Earth. Many compass apps offer a true-north setting, and physical compasses can also be thrown off by nearby metal, electronics, or magnets. For the most reliable result, use a compass app with true-north mode enabled, hold it flat and away from metal objects, and rotate until it matches the heading shown above.

Frequently asked questions

How is the Qibla bearing calculated?

It uses the great-circle initial-bearing formula from spherical trigonometry, applied to your latitude and longitude and the Kaaba's fixed coordinates in Makkah, giving the shortest-path compass heading that accounts for the Earth's curvature.

Why isn't the Qibla just a straight line on a map?

Every flat world map distorts area, distance, or direction when projecting a curved surface onto a plane. Over long distances, a straight line drawn on such a map points noticeably away from the true, curvature-corrected great-circle direction.

How far is my location from the Kaaba?

This tool calculates the great-circle distance using the haversine formula, the standard method for measuring distance between two points on a sphere from their coordinates, and displays the result in both kilometers and miles.

Does this tool require an internet connection?

No. Once the page has loaded, the bearing and distance are calculated entirely offline from pure geometry using the coordinates you provide, with no external service involved.

How do I use the compass reading in real life?

Open a compass app or use a physical compass, ideally with true-north mode enabled, hold it flat and away from metal or electronics, and rotate until it matches the bearing shown above to face the direction of the Kaaba.