Qibla Direction
This qibla direction finder gives the bearing to the Kaaba in degrees from true north, with its compass point and distance, from your location, a city or coordinates. From London the qibla is about 119° (east-south-east); from Islamabad it is about 256° (west-south-west).
Processed on your device. Nothing is uploaded.
Your location
Your location is used only on this device.
Works offline. World cities over 100,000 people, and smaller cities in Pakistan.
Qibla direction
Use your location, pick a city or type coordinates to see the qibla.
Phone compasses can be off by 5 to 10°. Calibrate by moving the phone in a figure-8, hold it flat and away from metal, and check the direction against a known landmark or your local mosque. Some phones show magnetic north, which is not exactly true north; this page always gives the bearing from true north.
How to use the qibla finder
- Tap Use my location, or search for your city, or type your latitude and longitude.
- Read the bearing in degrees from true north, its compass point (for example 256° WSW) and the distance to the Kaaba.
- On a phone, tap Live compass and hold the phone flat. The dial turns with you; face the way the green arrow points.
How it works
The calculator finds the great-circle bearing (the starting direction of the shortest path over the Earth’s surface) from your position to the Kaaba at 21.422487° N, 39.826206° E:
bearing = atan2(sin Δλ · cos φ₂, cos φ₁ · sin φ₂ − sin φ₁ · cos φ₂ · cos Δλ)
Here φ₁ is your latitude, φ₂ the Kaaba’s latitude and Δλ the difference in longitude. The result is turned into degrees from 0 to 360 clockwise from true north. The distance uses the haversine formula with a mean Earth radius of 6,371 km.
The city list comes from GeoNames (CC BY 4.0): world cities over 100,000 people, plus every Pakistani city in its 15,000-plus file. It loads only when you start typing.
Facing the qibla
Muslims face the Masjid al-Haram in prayer: “turn your face towards the Sacred Mosque; wherever you are, turn your faces towards it” (Quran 2:144). Use the bearing with a reliable compass, a known landmark or the sun. If you pray at a mosque, its mihrab already shows the direction.
Getting a good compass reading
- Calibrate first: move the phone slowly in a figure-8 a few times.
- Hold it flat and away from metal, magnets, cars and speakers.
- Expect an error of 5 to 10° on many phones. If two phones disagree, trust a fixed mosque mihrab or a sun-based method over either.
- If your phone shows magnetic north, adjust by the local declination from NOAA. This calculator always gives the bearing from true north.
Frequently asked questions
What is the qibla direction from my city?
Measured clockwise from true north and calculated by this tool, the qibla is about 119° from London, 58.5° from New York, 151.6° from Istanbul, 277.6° from Dhaka, 292.5° from Kuala Lumpur and 295.2° from Jakarta. In Pakistan it is about 255.9° from Islamabad, 260.4° from Lahore and 267.7° from Karachi. Search for your own city above for its exact bearing.
As an independent check of the formula, Malaysia’s Department of Survey and Mapping (JUPEM, Geodesy Section) gives the qibla of Masjid Negara, Kuala Lumpur (3°08′33″N, 101°41′32″E) as 292°32′00″ from north, published by the Federal Territory Mufti’s office. This calculator gives 292°32′07″ for the same point, about 0.002° away.
Why does my phone compass give a different answer?
Phone compasses can be off by 5 to 10° near metal, cars or electrical wiring, and need calibrating with a figure-8 movement. Some phones show magnetic north, which is not the same as true north. The difference (magnetic declination) changes with place and time; NOAA’s calculator gives it for your location.
Does the calculator need the internet?
No. Once the page has loaded, the bearing, distance and city search all work offline. Your location is never sent anywhere.
Why does the qibla from New York point north-east, not south-east?
Because the shortest path over a globe is a great circle. On a flat map Makkah looks south-east of New York, but the shortest route curves north over the Atlantic, so the bearing is about 58.5°.
Related tools
Sources and review
- Quran 2:144: facing the Sacred Mosque (Quran.com)
- GeoNames city data (CC BY 4.0)
- NOAA NCEI: magnetic declination
Last reviewed: .