How Prayer Times Are Calculated: A Worked Example
Prayer times come from the sun's position: solar noon, depression angles for Fajr and Isha and the Asr shadow rule, with a worked example for London.
A prayer timetable is a calculation redone every day. Each of the five prayers is tied to something you can see in the sky, and astronomy lets us predict those moments for any place and date. This article explains the pieces in plain language and then works through one real day for one city. If you just want the result, the prayer times tool does all of this for you.
What the calculation actually needs
Only four inputs:
- Latitude: how far north or south you are. It controls how high the sun climbs and how long twilight lasts.
- Longitude: how far east or west. It shifts solar noon relative to clock noon by four minutes per degree.
- Date: it sets the sun's declination (its position north or south of the equator) and the equation of time.
- Time zone and daylight saving rule: to turn universal time into the time on your wall clock.
Everything else, the angles for Fajr and Isha and the shadow rule for Asr, is a choice made by a scholarly or national body. Those choices are the calculation methods.
Step 1: solar noon
The sun is highest at solar noon, when it crosses your meridian. Solar noon in universal time is approximately:
12:00 minus (longitude × 4 min) minus the equation of time
The equation of time is a correction of up to about 16 minutes caused by the Earth's tilted axis and oval orbit: about minus 14 minutes in early February, plus 16 in early November. Dhuhr begins just after solar noon; most calculators add a minute or two.
Step 2: sunrise and sunset
Sunrise and sunset happen when the centre of the sun is about 0.83° below the horizon. That odd number covers the sun's radius (0.27°) and atmospheric refraction, which bends light so we see the sun slightly before it is geometrically up. The hour angle H of sunrise, measured from solar noon, comes from:
cos H = (sin a − sin φ × sin δ) ÷ (cos φ × cos δ)
where a is the sun's altitude (−0.83°), φ is latitude and δ is declination. Sunrise is solar noon minus H, sunset is solar noon plus H. Maghrib begins at sunset.
Step 3: Fajr and Isha from depression angles
Dawn and dusk twilight depend on how far below the horizon the sun is. The same formula works; only the altitude a changes. Fajr is computed with a negative angle such as −18° (Muslim World League), −15° (ISNA) or −19.5° (Egypt). Isha uses −17°, −15° or −17.5° respectively, or in the Umm al-Qura method a fixed 90 minutes after Maghrib.
The angle is the whole argument between methods: which value best matches the true dawn of the hadith (see Fajr and true dawn) and the end of red twilight (see Isha and shafaq).
Step 4: Asr from the shadow
Asr is defined by shadow length, not by an angle below the horizon. A vertical stick of height 1 casts a shadow at noon of tan(φ − δ), taken as a positive number. Asr begins when the shadow equals the noon shadow plus 1 (standard) or plus 2 (Hanafi). Converting that shadow length into a sun altitude, and then into an hour angle with the same formula, gives the time. The Asr article has a table of the resulting differences.
A worked example: London, Monday 8 February 2027
This is the expected first day of Ramadan 1448. Numbers are rounded, which is fine for seeing the method.
- Latitude 51.51° N, longitude 0.13° W, time zone GMT (no daylight saving in February).
- Sun's declination on 8 February: about −15.2° (the sun is south of the equator).
- Equation of time: about −14 minutes.
Solar noon. 12:00 + 0.5 min (0.13° west × 4) + 14 min = about 12:14 GMT. The timetable prints Dhuhr as 12:16.
Sunrise and sunset. With a = −0.83°, φ = 51.5°, δ = −15.2°: cos H = (−0.0145 − (0.783 × −0.262)) ÷ (0.623 × 0.965) = 0.190 ÷ 0.601 = 0.317, so H = 71.5°, which is 4 h 46 min. Sunrise = 12:14 − 4:46 = 07:28. Sunset = 12:14 + 4:46 = 17:00; with the usual rounding up for safety the tool shows Maghrib 17:02.
Fajr at 18°. With a = −18°: cos H = (−0.309 + 0.205) ÷ 0.601 = −0.173, so H = 100°, which is 6 h 40 min. Fajr = 12:14 − 6:40 = 05:34.
Isha at 17°. The same calculation with a = −17° gives H of about 6 h 36 min, so Isha = 12:14 + 6:36 = 18:50.
Asr (standard). Noon shadow = tan(51.5 + 15.2) = tan 66.7° = 2.32. Asr shadow = 3.32, so the sun's altitude is arctan(1 ÷ 3.32) = 16.8°. Putting a = +16.8° into the formula gives H of about 2 h 22 min, so Asr = 12:14 + 2:22 = 14:36. The Hanafi shadow of 4.32 gives an altitude of 13.0° and Asr at 15:14.
The finished row:
| Fajr | Sunrise | Dhuhr | Asr | Maghrib | Isha |
|---|---|---|---|---|---|
| 05:34 | 07:28 | 12:16 | 14:36 (Hanafi 15:14) | 17:02 | 18:50 |
Use ISNA's 15° instead of 18° and Fajr becomes 05:53, nineteen minutes later, while sunrise, Dhuhr, Asr and Maghrib do not change at all: only Fajr and Isha depend on the method.
Why coordinates and time zone matter so much
- Ten kilometres east or west moves solar times by about 30 seconds; across a large city that is one or two minutes.
- One degree of latitude (about 111 km north or south) changes Fajr and Isha by a few minutes in winter and far more in summer, because twilight stretches out at higher latitudes.
- The wrong time zone is the most common real-world error. A phone set to the wrong zone, or a calculator unaware that daylight saving begins on a given Sunday, produces times that are exactly one hour off while looking perfectly plausible.
Above about 48° latitude the summer sun never sinks 18° below the horizon, so the Fajr and Isha equations have no solution and a substitute rule is needed; see high-latitude prayer times.
How our tool does it
Salah Table uses the open-source adhan library for the astronomy and applies the angles, Asr rule, high-latitude rule and the small precaution offsets documented for each method. Times are computed in universal time, converted to the city's zone with its own daylight saving rules, and rounded to the minute. None of this replaces your local masjid: follow its timetable for congregation, use this site to understand it, and for your own practice ask a scholar or imam you trust.
Useful tools
Questions and answers
Why is Dhuhr not at 12:00?
Clock noon and solar noon are different things. Your clock is set for a whole time zone, while the sun is highest at a moment that depends on your exact longitude and on the equation of time, which swings by about plus or minus 15 minutes across the year. Daylight saving time adds a further hour.
What is a depression angle?
How far the centre of the sun is below the horizon, in degrees. Sunset is about 0.83° (the disc plus refraction). Fajr is usually 15° to 20°, Isha 14° to 18°. The larger the angle, the earlier Fajr and the later Isha.
How accurate are calculated times?
The astronomy is accurate to well under a minute. The uncertainty is in the choice of angle for Fajr and Isha, which is a matter of observation and scholarly judgement rather than mathematics, and in rounding. That is why timetables differ by minutes or more, not because anyone's maths is wrong.
Does altitude matter?
A little. From a high building or a mountain the horizon dips, so sunrise is seen slightly earlier and sunset slightly later, by roughly one minute per 300 m for a clear sea horizon. Most calculators, including ours, ignore this; a few Gulf timetables apply a small correction.
Why does my app ask for my time zone?
The calculation gives moments in universal time. To print 05:34 instead of 05:34 UTC it needs to know your offset, including whether daylight saving time is in force on that date. A wrong time zone shifts every prayer by whole hours.
Sources
- Qur'an 17:78; 11:114; 30:17-18
- Sahih Muslim 612 (times of the prayers)
- Sunan Abi Dawud 393 (Jibril leading the prayers)
- adhan-js, open-source prayer-times library (astronomical formulas based on Jean Meeus, Astronomical Algorithms)