Qibla Finder — Free Online Qibla Direction Calculator
Find the precise direction of the Qibla from anywhere in the world. Enter your latitude and longitude or use the GPS button to detect your location automatically. Get the exact bearing in degrees, compass direction, and distance to the Kaaba in Makkah.
Tip: Click "Use My Location" to automatically detect your GPS coordinates, or enter them manually. The Kaaba is located at 21.4225 N, 39.8262 E in Makkah, Saudi Arabia.
Qibla Direction Results
Summary: From your location (40.7128, -74.006), the Qibla direction is 58.48° (ENE). The Kaaba is approximately 10,306 km away.
How to Use the Qibla Finder
- Enter your latitude: Type your location's latitude in decimal degrees into the Latitude field. Latitude ranges from -90 (South Pole) to +90 (North Pole). For example, New York City is at approximately 40.7128 north. You can find your latitude by searching your city name followed by "coordinates" on any search engine or by using Google Maps.
- Enter your longitude: Type your location's longitude in decimal degrees into the Longitude field. Longitude ranges from -180 (far west) to +180 (far east). For example, New York City is at approximately -74.0060 (negative because it is west of the Prime Meridian). Longitude combined with latitude uniquely identifies your position on Earth for precise Qibla calculation.
- Or use automatic location detection: Click the "Use My Location" button to let your device's built-in GPS automatically detect your exact coordinates. Your browser will ask for permission to access your location. Grant the permission and your latitude and longitude will be filled in automatically. This method provides the most accurate coordinates, especially on mobile devices with GPS hardware.
- Read the Qibla direction: The results panel displays the Qibla bearing in degrees from true north (0-360), the compass direction (e.g., NE for northeast), the distance from your location to the Kaaba in kilometers, and a visual compass indicator showing the direction. To face the Qibla for prayer, use a physical compass or your phone's compass app and align yourself to the indicated bearing.
The compass needle in the results panel visually points in the Qibla direction. Remember that the bearing is measured from true north, so adjust for magnetic declination if using a magnetic compass.
Qibla Direction Formula and How It Works
Bearing = atan2(sin(dLng), cos(lat1) x tan(lat2) - sin(lat1) x cos(dLng)) Distance = R x 2 x atan2(sqrt(a), sqrt(1-a)) where:
a = sin(dLat/2)^2 + cos(lat1) x cos(lat2) x sin(dLng/2)^2 Variables Explained
- lat1, lat2: The latitudes of your location and the Kaaba (21.4225 N) respectively, converted to radians for trigonometric calculations. Latitude measures the angular distance north or south of the equator.
- dLng: The difference in longitude between the Kaaba (39.8262 E) and your location, converted to radians. This angular difference, combined with the latitudes, determines the bearing along the great-circle path.
- dLat: The difference in latitude between the Kaaba and your location, used in the Haversine distance formula. This measures how far north or south you are relative to the Kaaba.
- R: The mean radius of the Earth, approximately 6,371 kilometers. This constant is used to convert the angular distance from the Haversine formula into a linear distance in kilometers.
- Bearing: The initial compass direction from your location to the Kaaba, measured in degrees clockwise from true north (0 to 360 degrees). This is the direction you should face for prayer.
- Distance: The great-circle (shortest path on the surface of a sphere) distance from your location to the Kaaba in kilometers. This is calculated using the Haversine formula, which accounts for Earth's spherical geometry.
Step-by-Step Example
Calculate the Qibla direction from New York City (40.7128 N, 74.0060 W):
- Convert coordinates to radians: lat1 = 40.7128 x pi/180, lat2 = 21.4225 x pi/180
- Calculate longitude difference: dLng = (39.8262 - (-74.0060)) x pi/180 = 113.8322 x pi/180
- Compute bearing components: y = sin(dLng), x = cos(lat1) x tan(lat2) - sin(lat1) x cos(dLng)
- Bearing = atan2(y, x) converted to degrees = approximately 58.48 degrees
- Compass direction: 58.48 degrees falls in the ENE (east-northeast) sector
- Distance using Haversine: approximately 10,146 km from NYC to the Kaaba
From New York City, the Qibla is approximately 58.5 degrees from true north, which is in the east-northeast direction. This means Muslims in New York face roughly ENE during prayer, and the Kaaba is about 10,146 kilometers away via the great-circle route.
Practical Examples
Example 1: Bilal in London, United Kingdom
Bilal recently moved to London and wants to determine the Qibla direction for his apartment so he can mark a permanent prayer spot. He enters the coordinates for central London (51.5074 N, 0.1278 W):
- Latitude: 51.5074
- Longitude: -0.1278
- Qibla bearing: approximately 119 degrees from true north
- Compass direction: ESE (east-southeast)
- Distance to Kaaba: approximately 4,583 km
Bilal uses a compass app on his phone to find 119 degrees in his living room and places a small marker on the wall. He verifies the direction by checking that it aligns with the southeast corner of his room, which is consistent with the ESE bearing. This permanent marker means he does not need to recalculate the Qibla direction each time he prays.
Example 2: Layla Traveling in Tokyo, Japan
Layla is on a business trip in Tokyo and needs to find the Qibla from her hotel room. She clicks "Use My Location" on her phone and the GPS detects her coordinates (35.6762 N, 139.6503 E):
- Latitude: 35.6762
- Longitude: 139.6503
- Qibla bearing: approximately 293 degrees from true north
- Compass direction: WNW (west-northwest)
- Distance to Kaaba: approximately 8,848 km
From Tokyo, the Qibla is WNW (west-northwest), which might surprise those who expect it to be due west. The great-circle route from Japan to Makkah curves northward over Central Asia, resulting in a bearing closer to WNW than due west. Layla uses her phone compass calibrated for Tokyo's magnetic declination to find 293 degrees and marks the direction in her hotel room for the duration of her stay.
Example 3: Ibrahim in Lagos, Nigeria
Ibrahim wants to verify the Qibla direction at his newly built mosque in Lagos. He enters the coordinates (6.5244 N, 3.3792 E):
- Latitude: 6.5244
- Longitude: 3.3792
- Qibla bearing: approximately 55 degrees from true north
- Compass direction: NE (northeast)
- Distance to Kaaba: approximately 5,003 km
From Lagos, Nigeria, the Qibla is northeast at approximately 55 degrees. Ibrahim uses this precise bearing to align the mihrab (prayer niche) of his mosque, ensuring that the congregation faces the correct direction. He cross-references this calculation with the local Islamic authority's official Qibla direction and finds them in agreement within one degree, confirming the accuracy of the tool.
Example 4: Zara in Sydney, Australia
Zara lives in Sydney and wants to set up a prayer space in her new apartment. She enters Sydney's coordinates (-33.8688 S, 151.2093 E):
- Latitude: -33.8688
- Longitude: 151.2093
- Qibla bearing: approximately 278 degrees from true north
- Compass direction: W (west)
- Distance to Kaaba: approximately 12,035 km
From Sydney, the Qibla direction is almost due west at 278 degrees. Being in the Southern Hemisphere and far east, the great-circle route from Sydney to Makkah goes westward across the Indian Ocean. At over 12,000 km, Sydney is one of the farthest major cities from Makkah. Zara places her prayer mat facing the western wall of her apartment and uses adhesive tape to mark the exact alignment.
Qibla Direction Reference Table
| City | Coordinates | Bearing | Compass | Distance (km) |
|---|---|---|---|---|
| New York, USA | 40.71, -74.01 | 58.5° | ENE | 10,146 |
| London, UK | 51.51, -0.13 | 119.0° | ESE | 4,583 |
| Istanbul, Turkey | 41.01, 28.98 | 153.1° | SSE | 2,254 |
| Cairo, Egypt | 30.04, 31.24 | 136.6° | SE | 1,234 |
| Jakarta, Indonesia | -6.21, 106.85 | 295.1° | WNW | 7,892 |
| Tokyo, Japan | 35.68, 139.65 | 293.0° | WNW | 8,848 |
| Sydney, Australia | -33.87, 151.21 | 277.5° | W | 12,035 |
| Los Angeles, USA | 34.05, -118.24 | 23.7° | NNE | 13,372 |
Bearings are approximate and measured from true north. Actual values may vary slightly based on exact coordinates within each city. Use the calculator above for precise results from your specific location.
Tips and Complete Guide
Setting Up a Permanent Prayer Space
Once you determine the Qibla direction using this tool, you can set up a permanent prayer space at home. Use a compass app on your smartphone to find the exact bearing, then place a small marker or sticker on the wall in that direction. Position your prayer mat perpendicular to the wall marker so you face it directly when standing. For newly built mosques or prayer rooms, it is important to determine the Qibla with high precision, and this tool combined with professional verification can ensure the mihrab is correctly oriented. Some Muslims also use a Qibla compass, a specially designed compass with Makkah's direction pre-marked for various regions.
Understanding Compass Calibration
If you are using a physical compass or smartphone compass app to align yourself with the Qibla bearing, ensure your compass is properly calibrated. Smartphone compasses can be affected by nearby magnets, electronic devices, metal structures, and magnetic interference from buildings. To calibrate a smartphone compass, move the phone in a figure-eight pattern several times. For physical compasses, keep them away from metal objects and electronic devices. Remember that our tool calculates the bearing from true north, but magnetic compasses point to magnetic north. The difference (magnetic declination) varies by location and can be significant in some regions. Check the magnetic declination for your area and adjust accordingly.
Qibla Direction While Traveling
When traveling, the Qibla direction changes with your location. Use the "Use My Location" button to quickly find the Qibla at each new destination. In hotels, airplanes, trains, and cruise ships, the direction may need to be recalculated as you move. Many hotels in Muslim-majority countries have Qibla direction arrows on the ceiling or in the nightstand drawer. On commercial flights, some airlines display Qibla direction on the in-flight entertainment system. For road trips, you can check the Qibla before departing and verify it at rest stops. If you are unable to determine the exact direction while traveling, Islamic jurisprudence permits making your best estimate based on available information.
Common Mistakes to Avoid
- Confusing latitude and longitude order: Latitude comes first and represents north-south position (-90 to +90). Longitude comes second and represents east-west position (-180 to +180). Swapping them produces a completely wrong Qibla direction. Our labeled fields help prevent this error.
- Ignoring magnetic declination: If you use the calculated bearing with a magnetic compass without adjusting for magnetic declination, your prayer direction could be off by several degrees depending on your location. In some places, declination exceeds 20 degrees. Use true north or adjust your compass reading.
- Relying on flat map intuition: Looking at a flat Mercator map and pointing "toward" Makkah gives a rhumb line direction, not the great-circle (shortest path) direction. The great-circle Qibla direction can differ by 30-40 degrees from what a flat map suggests, especially for locations far from Makkah.
- Not recalibrating when moving: If you travel to a new city or even a different part of a large metropolitan area, the Qibla direction changes slightly. Recalculate when you change locations rather than assuming the direction is the same everywhere in a country.
- Poor GPS signal indoors: GPS accuracy decreases inside buildings, which can affect the "Use My Location" feature. If the detected coordinates seem wrong, try using the feature outdoors or near a window, or enter coordinates manually based on your known address.
Frequently Asked Questions
The Qibla is the direction that Muslims face during their five daily prayers (salah). It points toward the Kaaba, the sacred cubic structure located in the center of al-Masjid al-Haram (the Grand Mosque) in Makkah, Saudi Arabia. The Kaaba is situated at approximately 21.4225 degrees north latitude and 39.8262 degrees east longitude. Facing the Qibla is a fundamental requirement for the validity of prayer in Islam, as commanded in the Quran (Surah Al-Baqarah 2:144). The direction varies depending on your location on Earth, and our Qibla finder calculates the precise bearing from any coordinates to the Kaaba using spherical geometry.
The Qibla finder uses the great-circle bearing formula from spherical trigonometry to calculate the shortest path between your location and the Kaaba. It takes your latitude and longitude, the Kaaba's coordinates (21.4225 N, 39.8262 E), and computes the initial bearing using the arctangent of the sine and cosine components of the angular difference. This produces a bearing in degrees from true north (0 to 360 degrees), along with the compass direction (N, NE, E, SE, etc.) and the great-circle distance in kilometers. The great-circle path represents the shortest distance between two points on a sphere, which is why the Qibla direction from North America is northeast rather than east.
From the continental United States, the Qibla direction is generally northeast (between 45 and 60 degrees) rather than east. This seems counterintuitive since Makkah is east of the US on a flat map. However, Earth is a sphere, and the shortest path (great-circle route) from the US to Makkah curves northward over the Atlantic Ocean and Europe. This is the same reason why transatlantic flights from New York to London fly over eastern Canada and Greenland rather than straight east. The Mercator map projection that most people are familiar with distorts great-circle routes, making them appear curved on the flat map even though they represent the true shortest path on the globe.
The mathematical calculation of the Qibla direction is highly accurate, typically within a fraction of a degree when precise GPS coordinates are used. The formula accounts for the spherical geometry of the Earth and produces results that match professional geodetic calculations. However, practical accuracy also depends on how precisely you know your own location coordinates and how accurately you can align yourself with the computed bearing. Using the GPS-based 'Use My Location' feature provides coordinates accurate to within a few meters, which translates to Qibla direction accuracy well within one degree. For most practical prayer purposes, being within 5 degrees of the precise Qibla is considered acceptable by scholars.
Yes, the Qibla finder works on any device with a web browser, including smartphones and tablets. The 'Use My Location' button uses your device's built-in GPS to automatically detect your latitude and longitude. On mobile devices, you may need to grant location permission when prompted by your browser. For the most accurate results, use the tool outdoors or near a window where GPS signals are stronger. Note that this tool provides the Qibla bearing in degrees from true north. To use it practically, you can compare the bearing with a compass app on your phone, keeping in mind that magnetic north and true north differ by the magnetic declination in your area.
True north is the direction toward the geographic North Pole, while magnetic north is the direction a magnetic compass needle points, which shifts over time due to changes in Earth's magnetic field. The difference between the two is called magnetic declination and varies by location. Our Qibla finder calculates the bearing from true north, which is the scientifically precise measurement. If you are using a physical magnetic compass to find the Qibla, you need to adjust for magnetic declination in your area. For example, if the magnetic declination is 10 degrees west and the Qibla is at 58 degrees true, you would look for 68 degrees on your magnetic compass. Most smartphone compass apps automatically compensate for magnetic declination.
The easiest method is to click the 'Use My Location' button in our Qibla finder, which uses your device's GPS to detect your coordinates automatically. Alternatively, you can find your coordinates by opening Google Maps, right-clicking (or long-pressing on mobile) on your location, and the coordinates will be displayed. You can also search for your city or address on Google followed by 'coordinates' to find approximate values. For reference, some major city coordinates are: New York (40.7128, -74.0060), London (51.5074, -0.1278), Istanbul (41.0082, 28.9784), Jakarta (-6.2088, 106.8456), and Cairo (30.0444, 31.2357).
Islamic scholars generally hold that facing the exact precise direction of the Qibla is required for those who can see the Kaaba. For everyone else, facing the general direction is sufficient for prayer to be valid. If you have made a reasonable effort to determine the Qibla but cannot be certain within a few degrees, your prayer is valid as long as you face the general direction. The Prophet Muhammad (peace be upon him) said that what is between the east and the west is Qibla (for people in Medina, which is north of Makkah). If you are traveling and completely unable to determine the Qibla, some scholars permit praying in any direction. Consult a qualified Islamic scholar for specific guidance based on your circumstances.
Related Calculators
Zakat Calculator
Calculate your annual 2.5% zakat obligation based on total wealth and nisab threshold.
Fitra Calculator
Calculate Sadaqat al-Fitr for your family based on staple food prices before Eid al-Fitr.
Hijri Calendar Converter
Convert dates between Gregorian and Hijri Islamic calendars with month names.
Zodiac Sign Calculator
Discover your Western and Chinese zodiac signs based on your birth date.
Distance Calculator
Calculate the distance between two points using coordinates or addresses.
Angle Converter
Convert angles between degrees, radians, and gradians instantly.
Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.
Last updated: February 23, 2026
Consult a qualified Islamic scholar for religious rulings on Qibla direction and prayer validity. This tool provides mathematical calculations and should not be considered a fatwa or religious ruling.
Sources
- IslamicFinder — Qibla Direction and Prayer Times: islamicfinder.org
- NIST — Time and Frequency Standards: nist.gov
- IslamiCity — Islamic Encyclopedia and Resources: islamicity.org