{{ summaryAnnouncement }}
{{ summarySentence }}
Compass preview unavailable.
Qibla finder controls
Qibla location and compass inputs
{{ locationSourceModeHelp }}
Search a city, district, landmark, or address; include a country for ambiguous names.
City Search uses OpenStreetMap data.
{{ locationError }}
{{ locationStatus }} {{ locationAccuracyNote }}
Choose the reference used by the instrument you will follow.
Accepted range: -30° to +30°. The tool subtracts east-positive declination from the true bearing.
°
{{ facingDisplay }}
0° is north, 90° east, 180° south, and 270° west.
°
Mean Earth is the normal spherical approximation; equatorial and polar radii support comparison.
Extra digits do not compensate for approximate location or compass data.
MeasureValueContextCopy
{{ row.label }}{{ row.value }}{{ row.context }}
{{ tableExportAnnouncement }}
{{ chartExportAnnouncement }}
StepGuidanceWhy it mattersCopy
{{ row.step }}{{ row.guidance }}{{ row.reason }}
{{ tableExportAnnouncement }}

The Qibla is the direction toward the Kaaba in Makkah from the place where a prayer is performed. It is a local bearing, so the answer depends on the observer’s latitude and longitude rather than a broad instruction such as “face east.” From some places the initial direction is west or northeast, and a flat world map can make the shortest path look counterintuitive.

A bearing measures clockwise from north. North is 0 degrees, east 90 degrees, south 180 degrees, and west 270 degrees. For distant points, the usual calculation follows the initial direction of a great-circle path on a spherical Earth model. The word initial matters because the heading along that curved surface route changes as the traveler moves, while a prayer direction uses the bearing at the starting location.

Factors that affect a practical Qibla direction
Factor Effect on the result Common source of error
Prayer location Sets the starting point for the bearing Using a city center, VPN location, or carrier gateway instead of the actual place
North reference Determines whether the number matches a map or a magnetic compass Following a true bearing on a compass without a current local declination
Current facing Changes only the left-or-right turn instruction Leaving an old facing value after moving or rotating
Compass environment Affects how faithfully a device points to magnetic north Nearby metal, electronics, poor calibration, or magnetic interference

True north and magnetic north are separate references. Maps and geographic bearings normally use true north. A physical compass follows the local magnetic field, whose angular difference from true north is magnetic declination. Declination changes by place and over time, so a value copied from another city or an old chart can shift the practical heading.

Location precision sets an upper limit on directional precision. Browser GPS may be useful outdoors, while a city search usually represents a mapped point and public-IP geolocation may resolve only to an ISP, VPN, proxy, or mobile gateway. Extra decimal places cannot recover accuracy that the starting coordinates or compass never had.

The calculated bearing is a practical aid, not a survey. Compare it with the prayer space, trusted local mosque guidance, and a calibrated instrument when the exact orientation matters. A surprising result is a reason to recheck the coordinates and north reference before assuming the geometry is wrong.

How to Use This Tool:

Confirm the prayer location first, then match the bearing reference to the map or compass you will actually follow.

  1. Choose Location source. Use City Search and select the intended mapped match, allow Browser GPS, request IP Geolocation for a rough estimate, or enter trusted decimal coordinates manually.
  2. Check the displayed Prayer location coordinates and accuracy note. Correct the latitude or longitude if the point does not represent the actual prayer space.
  3. Select True north for a map bearing. Select Magnetic north for a compass heading and enter a current local Magnetic declination from −30 to +30 degrees, with east positive and west negative.
  4. Set Current facing when left-or-right guidance is useful. The bearing remains the same; only the shortest turn from the entered facing changes.
  5. Read the selected bearing and turn instruction, then review Bearing record and Prayer setup. Recheck the compass calibration, coordinates, reference, and declination before relying on a precise-looking number.

Interpreting Results:

The main direction is Selected bearing, labeled true or magnetic. Cardinal direction is only a broad 16-point compass label. Turn guidance gives the shortest rotation from Current facing and reports aligned when the difference is no more than 0.5 degrees.

Great-circle distance is geographic context, not a road or flight distance. Choosing the mean, equatorial, or polar Earth radius changes that distance but does not change the bearing.

If the direction seems wrong, verify the coordinate pair before adjusting anything else. Then confirm that a map uses true north, a compass uses the correctly signed magnetic declination, and the current-facing value matches the instrument at the moment of use.

Technical Details:

The calculation uses the initial spherical bearing from the observer to a fixed Kaaba coordinate of 21.422487 degrees latitude and 39.826206 degrees longitude. Longitudes are east-positive, all trigonometric inputs use radians, and the final angle is normalized to the interval from 0 degrees inclusive to 360 degrees exclusive.

Formula Core:

Let φ and λ be the observer latitude and longitude, and let φK and λK be the Kaaba coordinates. The initial true bearing comes from the two-argument arctangent, which preserves the correct quadrant.

Δλ = λKλ y = sin(Δλ)cos(φK) x = cos(φ)sin(φK)sin(φ)cos(φK)cos(Δλ) Btrue = normalize(degrees(atan2(y,x)))

Magnetic mode subtracts an east-positive declination D from the true bearing. The shortest signed turn then compares the selected bearing with the current facing and wraps the difference into −180 through 180 degrees.

Bmagnetic = normalize(BtrueD) T = ((BF+540)mod360)180

A positive T means turn right, a negative value means turn left, and an absolute difference no greater than 0.5 degrees is labeled aligned.

The distance uses the haversine central angle c and a selected radius R. Available radii are 6,371 km mean, 6,378.137 km equatorial, and 6,356.752 km polar.

a = sin2(Δφ2)+cos(φ)cos(φK)sin2(Δλ2) c = 2atan2(a,1a) d = R×c

At the exact fixed Kaaba coordinate, the central angle is effectively zero and the bearing is undefined. Display precision from one to four decimal places affects presentation only; full intermediate precision is retained.

Accuracy and Privacy Notes:

Manual coordinates use the values entered in the browser. Browser GPS requests device permission. City Search sends the submitted place text to the OpenStreetMap Nominatim service, while IP Geolocation uses public-IP and geolocation services to obtain an approximate point. None of those location sources should be assumed equally precise.

  • Public-IP locations may represent an ISP, VPN, proxy, or carrier gateway rather than the prayer location.
  • Mapped city or address results should be checked for similarly named places and refined when the building location matters.
  • A compass needs a current local declination and freedom from nearby magnetic interference; more displayed decimals do not improve a weak measurement.

Worked Examples:

Kuala Lumpur from true north

For 3.1390 degrees latitude and 101.6869 degrees longitude, the true bearing is about 292.54 degrees, or WNW. From a current facing of 0 degrees, the shortest instruction is about 67.46 degrees left. Using the mean Earth radius gives about 6,973.89 km of great-circle distance.

Compass with west declination

A true bearing of 58.48 degrees with a declination of −12.5 degrees becomes a magnetic bearing of 70.98 degrees because subtracting a negative declination adds 12.5 degrees. Reversing the sign would point the compass 25 degrees away from that result.

References: