Skip to main content

Qibla Direction

Find the Qibla direction from anywhere on Earth: the initial great-circle bearing to the Kaaba in degrees from true north, the compass point and the distance, calculated in your browser.

Embed this widget

Customize the result, check the live preview, then copy the code.

Preview

Embed code type

Code to copy

Responsive and automatically resized by Bethemesh.

Find the Qibla direction

The bearing follows the great-circle path from your position to the Kaaba. Your position stays in the browser.

City search uses the Open-Meteo geocoding service.

Was this tool useful?

On this page

How does this tool work?

The Qibla is the direction of the Kaaba in Makkah, which Muslims face in prayer. The tool calculates it from anywhere on Earth: choose a city, use your location or enter latitude and longitude, and it shows the bearing in degrees from true north, the nearest compass point, an oriented needle and the distance to the Kaaba. From New York, for example, the Qibla is north-east at about 58.5°, not south-east as a flat map suggests.

On a sphere the shortest path between two points follows a great circle. The Qibla used here is the initial bearing of that great circle from your position to the Kaaba (21.4225° N, 39.8262° E), which is the convention of the vast majority of calculators and religious authorities. The bearing is measured clockwise from true north: 0° north, 90° east, 180° south, 270° west.

The distance uses the haversine formula on a spherical Earth with a mean radius of 6,371 km. Compared with an ellipsoidal WGS 84 calculation (Vincenty’s method), the difference stays below 0.2° for the bearing and 0.2% for the distance in the cities tested, far less than the accuracy of a compass.

How to use this tool

  1. Give your position

    Search for a city, use geolocation or enter latitude and longitude in decimal degrees.

  2. Read the bearing

    The bearing from true north and the compass point appear with an oriented needle.

  3. Find true north where you are

    With a compass, apply the magnetic declination; without one, use a map aligned with north or the sun at solar noon (due south in the northern hemisphere).

  4. Turn by the angle

    From north, turn clockwise by the angle shown.

The great-circle formulas

φ₁, λ₁: your latitude and longitude; φ₂, λ₂: those of the Kaaba; Δλ = λ₂ − λ₁.

Initial bearing (Qibla)

θ = atan2(sin Δλ × cos φ₂, cos φ₁ × sin φ₂ − sin φ₁ × cos φ₂ × cos Δλ), normalised to 0°–360°

Distance (haversine)

d = 2R × arcsin √(sin²(Δφ/2) + cos φ₁ × cos φ₂ × sin²(Δλ/2)), with R = 6,371 km

θ
Qibla bearing from true north, clockwise
φ
latitude (positive north)
λ
longitude (positive east)
R
mean Earth radius, 6,371.0088 km

Use cases

Find your bearings at home or in a hotel

Locate the prayer direction in an unfamiliar room from the bearing and a landmark: a street, a building, the position of the sun.

Set out a prayer room

When fitting out a space, use precise coordinates and transfer the bearing onto a plan aligned with true north.

Understand a surprising direction

From North America the Qibla is north-east, not south-east as a flat map suggests: the great circle crosses the North Atlantic.

Check a compass app

Compare the true bearing with what an app displays, once the magnetic declination is taken into account.

Examples

From London

The magnetic declination in London is about 1° east in 2026: on a compass, aim at about 118°.

Input

Latitude 51.5074, longitude −0.1278

Result

Bearing 119.0° (south-east), distance 4,794 km

From New York

The great circle heads north-east. The declination there is about 12.5° west: on a compass, aim at about 71°.

Input

Latitude 40.7128, longitude −74.0060

Result

Bearing 58.5° (north-east), distance 10,306 km

Tips and best practices

  • The bearing refers to true north. On a compass, subtract an easterly declination and add a westerly one.
  • Keep the compass or phone away from metal objects and electrical devices, and recalibrate the phone compass if in doubt.
  • A city is enough: hundreds of kilometres from Makkah, moving a few kilometres changes the bearing by only a fraction of a degree.
  • On a Mercator map the straight line to Makkah is not the shortest path; do not draw the Qibla with a ruler on that kind of map.

Sources and references

Frequently asked questions

Why is the direction not a straight line on the map?

Common maps distort directions. On the globe the shortest path follows a great circle whose initial bearing depends on your position. From North America it therefore heads north-east.

Which Kaaba coordinates are used?

21.4225° north and 39.8262° east, the centre of the Kaaba in the Masjid al-Haram in Makkah.

What is the difference between true north and magnetic north?

True north points to the geographic pole. Magnetic north, shown by a compass, differs by the magnetic declination, which varies with place and year (about 1° east in London, 12.5° west in New York in 2026).

Is a spherical calculation accurate enough?

Yes. The difference from a calculation on the Earth’s ellipsoid stays below 0.2° for the bearing, well below the orientation accuracy you can achieve on site.

Is my location sent anywhere?

No. Coordinates are used in the browser for the calculation. Only searching for a city by name queries a geocoding service.

What happens in Makkah or at the antipode?

At the Kaaba every direction is valid and the tool says so. Near the opposite point, in the Pacific south-east of Tahiti, every great circle reaches Makkah over the same distance, so the bearing has no precise meaning.

Related tools

Tools similar or complementary to this one.

Similar tools

Calculate Fajr, Sunrise, Dhuhr, Asr, Maghrib and Isha times for your city.

Dates & timeUse this tool

Convert a date and time from one time zone to another, daylight saving time included.

Dates & timeFeaturedUse this tool