Skip to content

Qibla Direction Calculator

Find which way to face for prayer from any city or exact coordinates: the Qibla bearing from true north, in words, on a compass rose, with the distance to the Kaaba in Makkah.

More options
Your place

 

Distance in

How far a magnetic compass points away from true north where you are. Your phone's compass app (some show true and magnetic north) or NOAA's online magnetic field calculator will tell you. It changes a little every year.

ResultUpdates as you type3060120150210240300330NESWQibla (great circle)Rhumb line—Qibla from true north———Distance to the Kaaba—Magnetic compass bearing—Rhumb line (one fixed heading)—Your coordinatesLive compassOn a phone, the rose turns so the needle points to the Qibla. Hold the phone flat, top pointing ahead.Phone compasses can be several degrees off near metal, magnets, speakers, cars or steel-framed buildings, and need calibrating: move the phone in a figure-of-eight a few times. Check the reading against the bearing above.

How your Qibla direction is worked out

Your place and the Kaaba, step by step: the gap in longitude, the east and north parts, the angle from north, then how far.

  1. 1

    Gap in longitude

    Kaaba 39.83° E
    you 55.27° E
    Δλ = −15.44°

  2. 2

    East and north parts

    φ 25.20° N
    y = −0.2479
    x = −0.0516

  3. 3

    Angle from north

    atan2(y, x)
    = 258.2° WSW
    11.8° south of west

  4. 4

    How far

    14.67° of arc
    × 6,371 km
    ≈ 1,633 km

Read more: the formula, a worked example, magnetic north and the sun method

The Qibla is the direction of the Kaaba in Makkah. Because the Earth is round, the direction you face is the start of the great circle from your place to the Kaaba: the shortest path over the Earth's surface, the way a plane flies. Its angle, measured clockwise from true north, is the Qibla bearing. This is the method used by almost every mosque, Islamic authority and Qibla app today.

The formula

Δλ = Kaaba longitude − your longitude
y = sin Δλ × cos(Kaaba latitude)
x = cos(your latitude) × sin(Kaaba latitude) − sin(your latitude) × cos(Kaaba latitude) × cos Δλ
Qibla = atan2(y, x), turned into 0° to 360° clockwise from true north
distance: cos c = sin(your lat) × sin(Kaaba lat) + cos(your lat) × cos(Kaaba lat) × cos Δλ, then c (in radians) × 6,371 km

The Kaaba is at 21.4225° N, 39.8262° E. North and east are positive, south and west negative. atan2(y, x) is the angle whose tangent is y ÷ x, placed in the right quarter of the circle by the signs of y and x. The distance shown in the result uses the Earth's true oval shape (the WGS-84 ellipsoid, Vincenty's method), which is a few km more accurate than the round-Earth figure.

Worked example

Take Dubai: 25.2048° N, 55.2708° E.

Δλ = 39.8262 − 55.2708 = −15.4446°. So sin Δλ = −0.26631 and cos Δλ = 0.96389. For the latitudes, sin 25.2048° = 0.42586, cos 25.2048° = 0.90479, sin 21.4225° = 0.36524 and cos 21.4225° = 0.93091.

y = −0.26631 × 0.93091 = −0.24791.

x = 0.90479 × 0.36524 − 0.42586 × 0.93091 × 0.96389 = 0.33047 − 0.38212 = −0.05165.

y ÷ x = −0.24791 ÷ −0.05165 = 4.7998, and the angle with that tangent is 78.23°. Both y and x are negative, so the direction is in the south-west quarter: 180° + 78.23° = 258.23°. The Qibla from Dubai is 258.2° from true north, west-south-west, or 11.8° south of due west (270° − 258.2°).

Distance: cos c = 0.42586 × 0.36524 + 0.90479 × 0.93091 × 0.96389 = 0.15554 + 0.81186 = 0.96740, so c = 14.669° = 0.25602 radians, and 0.25602 × 6,371 km = 1,631 km on a round Earth. On the true oval Earth it is 1,633 km (1,015 miles, 882 nautical miles), which is what the result shows.

Qibla from major cities

CityQibla (true north)DirectionDistance
Doha252.6°West-south-west1,270 km
Dubai258.2°West-south-west1,633 km
Delhi266.6°West3,840 km
Jakarta295.2°West-north-west7,922 km
London119.0°East-south-east4,795 km
Cape Town23.4°North-north-east6,532 km
New York58.5°East-north-east10,324 km
Sydney277.5°West13,237 km

Great circle or rhumb line?

A rhumb line keeps one compass heading the whole way, so it is a straight line on a normal (Mercator) map. It looks natural on a flat map, but it is longer. From New York the rhumb line to Makkah heads 101.3° (east-south-east), while the great circle starts at 58.5° (east-north-east). Measured on the same round Earth, the rhumb line is about 10,965 km and the great circle about 10,306 km, so the flat-map route is about 660 km longer. Islamic scholars and bodies such as national religious authorities use the great-circle direction, because the Qibla means facing the Kaaba by the shortest way across the Earth. A few older North American mosques were built facing south-east using the flat-map direction. Switch to Advanced to compare the two for your place. Close to Makkah the two are almost the same.

True north and magnetic north

The bearing above is from true north (towards the North Pole). A magnetic compass points to magnetic north, which differs by the magnetic declination: a few degrees in the Gulf and India, but 10° to 15° or more in parts of North America. To use a compass, subtract an east declination from the true bearing (or add a west one). Example: with 2° E, a true 258.2° reads 256.2° on a compass. Your phone's compass app or NOAA's magnetic field calculator shows the declination for your place; this calculator does not guess it for you.

Using the sun

When the sun is directly over the Kaaba (around 27–28 May and 15–16 July, at about 12:18 and 12:27 Makkah time), it sits exactly in the Qibla direction for everyone who can see it, so shadows point straight away from the Qibla. When it is over the opposite side of the Earth (about 12–13 January and 28–29 November, around 00:29 and 00:09 Makkah time, which is daytime in the Americas and the Pacific), shadows point towards the Qibla. The exact date and minute shift slightly from year to year; the calculator works them out from the sun's position (NOAA solar equations) for the coming year and shows them in your time zone. A few minutes either side still gives a direction good to a degree or two in most places.

Method: great-circle initial bearing on a sphere and distance on the WGS-84 ellipsoid (Vincenty). Bearings and distances were checked on 13 October 2026 against an independent calculation in Python (3-D vectors for the bearing, geographiclib for the distance) for Doha, Dubai, London, New York, Jakarta, Sydney and Cape Town, all within 0.01° and 1 km. Sun times were checked against the astral library to within a minute. City coordinates are for the city centre; for the exact spot, type your coordinates or use your location.

Common questions

What is the Qibla direction from Dubai?

From Dubai the Qibla is 258.2° from true north, which is west-south-west: face 11.8° south of due west. The Kaaba is about 1,633 km away. From Abu Dhabi it is about 260.2°, from Doha 252.6° and from Riyadh 243.8°.

What is the Qibla direction from London, New York and Sydney?

From London the Qibla is 119.0° (east-south-east), from New York 58.5° (east-north-east) and from Sydney 277.5° (just north of west). These are great-circle bearings from true north, which is how almost every mosque and Qibla app works it out.

Why is the Qibla north-east from America and not south-east?

Because the shortest way over a round Earth is a great circle, not a straight line on a flat map. From New York the shortest route to Makkah heads north-east over the Atlantic and curves south over Europe. On a flat map it looks like the Qibla should be east-south-east (the rhumb line, about 101°), but that path is about 660 km longer.

How do I find the Qibla with a normal compass?

A compass points to magnetic north, not true north. Take the Qibla bearing from this page, then subtract your magnetic declination if it is east (or add it if it is west). Your phone's compass app or NOAA's online magnetic field calculator shows the declination for your place. Hold the compass flat, away from metal, turn until it reads that number, and face that way.

How can I find the Qibla using the sun?

Twice a year, around 27–28 May at 12:18 and 15–16 July at 12:27 Makkah time, the sun is directly over the Kaaba. At that moment, anywhere the sun is up, you face the Qibla by facing the sun, and shadows point away from it. Around 13 January at 00:29 and 28–29 November at 00:09 Makkah time the sun is over the opposite side of the Earth, so shadows point toward the Qibla. Switch to Advanced to see these times in your own time zone.

How accurate is a phone Qibla compass?

The maths is exact, but a phone's compass can be several degrees out, or much more next to metal, magnets, speakers, cars or a steel-framed building. Calibrate it by moving the phone in a figure-of-eight, hold it flat, and check it against the bearing and a landmark. Small errors are forgiven: scholars accept facing the general direction when the exact one can't be known.

Related calculators

Prayer times calculatorFajr, sunrise, Dhuhr, Asr, Maghrib and Isha for any city or coordinates, with 9 calculation methods, Hanafi Asr, next prayer countdown, high-latitude rules, midnight and last third of the night, and a printable month timetable.Hijri date converterGregorian to Hijri and back with Umm al-Qura or tabular calendars, Arabic month names, today’s Hijri date, days to Ramadan and Eid, age in Hijri years and a full year of months.Sunrise and sunset calculatorSunrise, sunset, solar noon, day length, twilight, golden hour and blue hour for 180+ cities or any coordinates, with a month table.Flight distance calculatorGreat-circle distance between any two airports in nm, km and miles, with course, flight time, stops and CO2.

Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.

Embed this calculator on your site

Free to use on your website or blog. Paste this code where you want the calculator to appear. Please keep the credit link.

Qibla direction calculator by Zulu Calculator ↗