☪️ Qibla Direction Finder

Find the great-circle direction to the Kaaba in Mecca from your location, in degrees from true North.

Your Location

Qibla Direction

Direction from True North
N
Distance to Mecca
Kaaba Coordinates
21.4225° N, 39.8262° E

This shows the shortest great-circle direction to the Kaaba. When using a physical compass, note that magnetic North differs from true North (magnetic declination) and varies by location, so calibrate accordingly.

Advertisement

How the Qibla Direction Is Calculated

The Qibla is the direction Muslims face during prayer, toward the Kaaba in Mecca, Saudi Arabia. Because the Earth is a sphere, the shortest path between two points is a great-circle route, not a straight line on a flat map.

Formula

Bearing θ = atan2( sin(Δlong) × cos(lat₂), cos(lat₁) × sin(lat₂) − sin(lat₁) × cos(lat₂) × cos(Δlong) )
Normalize θ to 0°–360° (this is the Qibla angle measured clockwise from true North)

Great-circle distance (Haversine):
a = sin²(Δlat/2) + cos(lat₁) × cos(lat₂) × sin²(Δlong/2)
distance = 2R × atan2(√a, √(1−a)), where R = 6371 km

Here lat₁/long₁ are your coordinates, lat₂/long₂ are the Kaaba's coordinates (21.4225° N, 39.8262° E), and Δlong = long₂ − long₁.

Frequently Asked Questions

Why doesn't the Qibla direction look like a straight line on a flat map?

Because the Earth is a sphere, the shortest path between two points (the great-circle route) often looks curved on a flat, rectangular map projection even though it's the most direct path in reality.

How accurate is this Qibla direction?

The bearing calculation is mathematically precise for the coordinates entered. Real-world accuracy depends on how precisely you know your own location and on correctly calibrating any physical compass you use, accounting for magnetic declination.

What is magnetic declination?

Magnetic declination is the difference between true North (used in this calculation) and magnetic North (what a compass needle points to). It varies by location and changes slowly over time, so a compass may need adjustment to align with the calculated true-North bearing.

Related Calculators