Qibla · California
Qibla direction in San Francisco
To face the Kaaba in San Francisco, turn to 18.8° measured clockwise from true north, which is north (18.8° east of north). The Sacred Mosque in Mecca lies 13,176 km away along the shortest path over the globe, and this is the direction the mihrabs of the mosques in San Francisco should follow.
Line up the top of your phone or compass with the green needle: it marks 18.8°, the Qibla of San Francisco. Phone compasses usually display true north, so a reading of 19° is all you need; a needle compass reads magnetic north and needs the local declination added or subtracted first.
Find the Qibla with your phone
How to face the Qibla in San Francisco
Stand where you will pray and find north first. Then turn towards north and move a further 18.8° towards east: the result is the bearing of 18.8°. A small error of a few degrees is forgiven by most scholars, but aiming simply at north would leave you about 19° off.
Facing the Qibla is a condition of the prayer. Whoever prays inside the Sacred Mosque faces the Kaaba itself; whoever is far away, as in San Francisco, faces its direction and makes a sincere effort to be accurate. A nearby mosque is a handy reference, because its prayer rows were aligned when it was built. Once you know the direction at home, a discreet mark on the wall saves you from checking again.
Why a flat map shows a different direction
This is a place where maps mislead badly: a straight line on a flat map from San Francisco to Mecca points to 96.6° (east), a full 77.8° away from the true Qibla of 18.8° (north). The map line keeps one compass heading and is 2,529 km longer than the great-circle route. Because the Earth is a sphere, the shortest way to Mecca from San Francisco first heads north, and that is the direction to face.
How is the figure of 18.8° obtained? From the coordinates of San Francisco (37.7749° N, 122.4194° W) and of the Kaaba (21.4225° N, 39.8262° E), spherical trigonometry gives the starting bearing of the great circle joining them. Mosque architects and astronomical Qibla tables rely on exactly the same calculation.
Distance from San Francisco to Mecca and Medina
Mecca is 13,176 km from San Francisco as the crow flies, and Medina, the city of the Prophet ﷺ, is 12,844 km away. A direct flight would take roughly 16 h, although most pilgrims from San Francisco connect through Jeddah or Medina airport.
Clocks in San Francisco run 11 hours behind Mecca in winter and 10 hours behind Mecca in summer, because of daylight saving time. Prayer times, however, depend on the sun at your own location, so always use the prayer times of San Francisco rather than those of Mecca.
Finding the Qibla with the sun in San Francisco
From San Francisco the sun never rises high in the Qibla direction of 18.8°, so you cannot simply face the sun. The opposite method works instead, as the right-hand column of the table shows.
On 365 days the sun stands exactly opposite the Qibla: then the shadow of any vertical object, a pole, a door frame or a plumb line, points straight towards Mecca. This is most frequent in January (31 days), for instance on 1 January 2027 at 13:26.
| Date | Sun in the Qibla direction (face the sun) | Sun opposite (shadows point to the Qibla) |
|---|---|---|
| 1 January 2027 | — | 13:26 |
| 15 January 2027 | — | 13:30 |
| 1 February 2027 | — | 13:29 |
| 15 February 2027 | — | 13:24 |
| 1 March 2027 | — | 13:17 |
| 15 March 2027 | — | 14:08 |
| 1 April 2027 | — | 13:56 |
| 15 April 2027 | — | 13:46 |
| 1 May 2027 | — | 13:38 |
| 15 May 2027 | — | 13:32 |
| 1 June 2027 | — | 13:30 |
| 15 June 2027 | — | 13:31 |
| 1 July 2027 | — | 13:35 |
| 15 July 2027 | — | 13:39 |
| 1 August 2027 | — | 13:44 |
| 15 August 2027 | — | 13:46 |
| 1 September 2027 | — | 13:48 |
| 15 September 2027 | — | 13:49 |
| 1 October 2027 | — | 13:50 |
| 15 October 2027 | — | 13:52 |
| 1 November 2027 | — | 13:56 |
| 15 November 2027 | — | 13:02 |
| 1 December 2027 | — | 13:10 |
| 15 December 2027 | — | 13:18 |
Twice a year the sun passes directly over the Kaaba, on 28 May 2027 and 16 July 2027. Both happen at night in San Francisco (02:18 and 02:27 local time), so they cannot be used here. Instead, on 13 January 2027 at 13:29 and 28 November 2027 at 13:09 the sun is over the point opposite the Kaaba, and every vertical shadow in San Francisco points straight to Mecca.
San Francisco compared with other cities
Compared with Washington D.C., 3,919 km away, the Qibla in San Francisco is turned 37.7° further anticlockwise (18.8° against 56.6°), and Mecca is 2,543 km farther away. The nearest city with its own Qibla page, Berkeley (17 km), prays towards 19.0°, a difference of 0.1°.
Across the 244 cities in the United States on this site, the Qibla ranges from 17.2° in Hillsboro to 350.9° in Anchorage, a spread of 333.7°. That is too large to use one national direction, so each city has its own bearing.
See all cities on the Qibla page for United States.
Qibla in cities near San Francisco
Qibla in San Francisco: questions and answers
What is the Qibla direction in San Francisco?
It is 18.8° from true north, which is north: 18.8° east of north.
How far is San Francisco from Mecca?
13,176 km in a straight line over the globe, and 12,844 km to Medina.
When does the sun show the Qibla in San Francisco?
The sun never stands in the Qibla direction here, but on 365 days it is exactly opposite, and shadows then point to Mecca.
Why is the Qibla in San Francisco not the direction shown on a map?
Flat maps distort directions. The line on a map points to 96.6°, but the shortest route on the globe leaves San Francisco at 18.8°, and that is the Qibla.
Does the Qibla change during the year?
No. The direction of 18.8° is fixed; only the times when the sun lines up with it change from day to day.
