The qibla, the direction of prayer, is the shortest path on the round earth from where you stand to the Kaaba in Makkah. Give this page your latitude and longitude and it gives you that bearing from true north, a compass to hold, the distance, and a card you can print and tape to the wall.
Accuracy to four decimal places is about eleven metres, far finer than any room needs. A bearing changes by less than a degree across a whole city.
Look it up once on the NOAA magnetic field calculator. East is positive, west is negative. Leave it empty if you do not know it.
The qibla in this room
The direction of prayer
from true north
east north east
Hold the card with N toward true north; the arrow then points the qibla.
So turn your face toward the Sacred Mosque · Qur'an 2:144
✦ noorcodex.com
The bearing above is measured from true north, the direction of the earth's axis. A magnetic compass, and the compass app in a phone, usually points at magnetic north, which drifts and differs from true north by anything from nothing to more than twenty degrees depending on where you stand. The gap has a name: magnetic declination.
Calibrate it first: open the compass app and move the phone in a wide figure of eight a few times until the app stops asking. Then stand away from steel doors, radiators, speakers, laptops and reinforced concrete columns, all of which pull the needle. Check the reading in two or three spots in the room; if they disagree, the metal is lying to you, not the sky. Many phone compasses can show true north instead of magnetic north in their settings, and that is the setting you want.
A shadow is an honest instrument. Two ways to use it:
Stand a straight stick upright on flat ground in the morning and mark the tip of its shadow every fifteen minutes through the middle of the day. The shortest shadow of the day is the moment of solar noon, and it lies exactly along the true north to south line: in the northern hemisphere the shadow points true north, in the southern hemisphere it points true south. Draw that line on the floor, then measure the qibla angle from it with a protractor.
Twice a year the sun passes directly over the Kaaba, and at that instant any upright object anywhere on the sunlit half of the earth casts a shadow pointing exactly away from Makkah: face along the shadow toward the sun and you face the qibla. It happens around 27 and 28 May at about 12:18 in Makkah, which is 09:18 UTC, and around 15 and 16 July at about 12:27 in Makkah, which is 09:27 UTC. Convert those UTC times to your own clock, wait for a sunny minute, and mark the line on the floor. This check needs no compass, no phone and no trust in either.
This page computes the great-circle bearing, the initial heading of the shortest path over a spherical earth, from your point to the Kaaba at latitude 21.4225 north, longitude 39.8262 east. It is the calculation used by nearly every qibla instrument and by the great majority of scholars. It is why masjids in North America face east and north of east rather than south east: on a globe, the shortest way to Makkah from Ottawa crosses the north Atlantic, and a flat map lies about that.
The distance shown is the great-circle distance on a sphere of mean radius 6371 kilometres, accurate to a few kilometres in several thousand.
✦ The NOOR masjid toolbox · free forever, no account
Everything is computed on your own device. Nothing is sent anywhere.