Skip to content
Online Compass

Great-circle bearing

Which direction is the qibla?

Short answer

The qibla is the great-circle bearing from where you are standing to the Kaaba in Mecca, at 21.4225 degrees north, 39.8262 degrees east. It depends entirely on your location, so there is no single answer.

The qibla is a direction on a sphere, and the shortest path between two points on a sphere is a great circle. On the flat maps most people picture, a great circle looks like a curve, which is why the qibla is frequently not the direction people expect.

From much of North America, for example, the bearing is north of east rather than the southeast a flat map suggests, because the short way to Mecca runs up over the pole. This is a mathematical fact about spheres, not a matter of interpretation.

Method

Step by step

In this order. Each step assumes the one before it is done.

  1. 01

    Establish your own position

    The calculation needs your latitude and longitude. The compass on this site can read them from your device if you allow location access, and they never leave the page.

  2. 02

    Compute the great-circle bearing

    The initial bearing from your position to the Kaaba is the standard forward azimuth formula on a sphere. Any qibla tool worth using implements exactly this; the differences between them come down to whether they model the earth as a sphere or an ellipsoid, which changes the answer by a fraction of a degree.

  3. 03

    Decide true or magnetic before you set it

    The computed bearing is a true bearing. Any compass, including the one here, reads magnetic until you give it a declination, and in some places the difference exceeds fifteen degrees. Look your declination up, enter it, and only then read off the qibla.

  4. 04

    Mark it where you will use it

    Once you have the bearing, stand facing it and mark something fixed in the room that lines up: an edge of the floor, a line of tiles, the corner of a rug. That way you are not repeating a sensor reading every time, and you are not depending on a compass indoors, where the reading is least reliable.

Reference

The bearings

The Kaaba, latitude
21.4225 degrees north.
The Kaaba, longitude
39.8262 degrees east.
From your position
Depends on where you are. Use the compass with location allowed.

How wrong can this be?

Accuracy

The formula is exact to well under a degree. The limiting factor is the compass reading, so indoors, near steel or with an uncalibrated device the error is the instrument, not the maths.