How Islamic Prayer Times Are Calculated: Solar Horizons, Twilight Angles, and Global Conventions
A comprehensive scientific and fiqh manual explaining the astronomical formulas, solar elevation angles, and shadow ratios used to compute accurate Islamic prayer times worldwide.
Software Engineering & Spherical Geodesy Research Group
True Geographic North vs. Magnetic North (WGS-84 Ellipsoid)
Calculates shortest geodesic arc along Earth's ellipsoidal curvature, rather than flat Mercator projections.
Automatically applies local magnetic declination offset so physical compass needles accurately find True North.
1. The Astronomical Foundation of the Five Daily Prayers
In Islamic jurisprudence, the timings of the five daily prayers (Salah) are linked directly to observable celestial phenomena—specifically the relative position of the Sun with respect to the local terrestrial horizon:
- Fajr (Dawn): Begins at the appearance of the true dawn (Al-Subh al-Sadiq), when horizontal light first spreads along the eastern horizon.
- Shuruq (Sunrise): The moment the upper edge of the Sun's disk appears on the eastern horizon. Prayer is prohibited at this exact moment.
- Dhuhr (Midday): Begins immediately after the Sun crosses the celestial meridian at local solar noon (Zawal), when shadows begin to lengthen.
- Asr (Afternoon): Begins when an object’s shadow reaches a specific ratio of its height plus its noon baseline shadow.
- Maghrib (Sunset): Begins the instant the upper limb of the Sun completely disappears beneath the western horizon.
- Isha (Night): Begins when the twilight afterglow (Al-Shafaq) completely fades from the sky.
Because these timings depend on solar geometry, they vary by latitude, longitude, elevation, and the day of the year. Modern prayer times calculators translate these classical observational definitions into precise spherical trigonometric algorithms.
2. The Science of Twilight: Fajr and Isha Solar Depression Angles
Unlike Dhuhr and Maghrib—which occur at well-defined geometric moments—Fajr and Isha depend on twilight phenomena caused by sunlight scattering in the upper atmosphere when the Sun is below the horizon.
Astronomers measure twilight by the Solar Depression Angle (the number of degrees the center of the Sun is positioned beneath the true horizon):
- Astronomical Twilight: Sun is $18^circ$ below the horizon.
- Nautical Twilight: Sun is $12^circ$ below the horizon.
- Civil Twilight: Sun is $6^circ$ below the horizon.
Different international Islamic bodies use slightly different depression angles based on empirical observations in their geographic zones:
| Organization / Authority | Fajr Depression Angle | Isha Parameter |
|---|---|---|
| Muslim World League (MWL) | $18.0^circ$ | $17.0^circ$ |
| Islamic Society of North America (ISNA) | $15.0^circ$ | $15.0^circ$ |
| Egyptian General Authority of Survey | $19.5^circ$ | $17.5^circ$ |
| Umm Al-Qura University (Makkah) | $18.5^circ$ | Fixed 90 min after Maghrib (120 min in Ramadan) |
| University of Islamic Sciences, Karachi | $18.0^circ$ | $18.0^circ$ |
| Union des Organisations Islamiques de France (UOIF) | $12.0^circ$ | $12.0^circ$ |
| Diyanet İşleri Başkanlığı (Turkey) | $18.0^circ$ | $17.0^circ$ |
3. Dhuhr & Asr: Zenith Passage and Shadow Ratio Geometry
Calculating Dhuhr (Solar Noon)
Dhuhr does not occur at 12:00 PM clock time. It occurs at Local Solar Noon, the exact transit moment when the Sun crosses the observer's local celestial meridian. To find this, our calculation engine evaluates the Equation of Time (EoT), which accounts for Earth's elliptical orbit and axial tilt:
$$\text{Solar Noon} = 12:00 + \text{Timezone Offset} - \frac{\lambda}{15} - \frac{\text{EoT}}{60}$$
A safety buffer of 1 to 2 minutes is added after the transit to ensure the Sun has truly passed the meridian before Salah begins (al-Zawal).
Calculating Asr Shadow Lengths
The start of Asr is determined by the length of an object's shadow relative to its height. Jurists define this using the shadow at solar noon ($S_0$):
- Standard Majority (Shafi'i, Maliki, Hanbali, Abu Yusuf, Muhammad al-Shaybani): Asr begins when the shadow equals the object's height plus its noon baseline: $$S = H + S_0$$
- Hanafi Principle (Asr al-Thani): According to Imam Abu Hanifah's primary narration, Asr begins when the shadow equals twice the object's height plus its noon baseline: $$S = 2H + S_0$$
The solar zenith angle $\theta$ for Asr is computed by: $$\theta = \operatorname{arccot}(n + \tan(\phi - \delta))$$ where $n = 1$ for the majority and $n = 2$ for the Hanafi standard, $\phi$ is the observer's latitude, and $\delta$ is the solar declination.
4. Maghrib and Sunrise: Atmospheric Refraction and Elevation Adjustments
When you watch the Sun set over the horizon, the physical solar disk has already slipped below the geometric horizon minutes earlier! Earth's atmosphere acts as a spherical lens, bending light rays upward by approximately 34 arcminutes ($0.566^circ$) at sea level.
Furthermore, the Sun is not an infinitesimal point of light; it has an apparent semi-diameter of approximately 16 arcminutes ($0.266^circ$).
Therefore, the geometric calculation for Sunrise and Sunset requires a total solar depression of: $$h_0 = -(0.566^circ + 0.266^circ) = -0.833^circ$$
Altitude Correction
If you are observing sunset from a high elevation (e.g. atop a mountain, in a skyscraper like the Burj Khalifa, or flying in an airplane), your visible horizon dips lower: $$\text{Dip Angle} \approx 0.0347^circ \times \sqrt{h\text{ (meters)}}$$ A resident on the 100th floor of a high-rise sees the sunset 2 to 3 minutes later than a pedestrian at ground level.
Frequently Asked Questions
Common practical situations regarding facing the Qibla, validated against classical juristic references.
Why do different prayer apps show slightly different Fajr times for my city?↓
How should I choose which prayer convention to follow?↓
Is prayer valid if performed immediately at the calculated prayer time?↓
Online Qibla Finder Research Team
Scholar AuthorSoftware Engineering & Spherical Geodesy Research Group
The engineering and research group behind Online Qibla Finder specializes in client-side spherical geodesy, WGS-84 ellipsoidal mathematics, and browser sensor fusion APIs (magnetometers, accelerometers, and GPS). Dedicated to building open, high-precision, privacy-first prayer tools without invasive tracking.
- ✓Implementation of Great-Circle spherical trigonometric algorithms (WGS-84)
- ✓Sensor fusion modeling for mobile MEMS magnetometers with dynamic calibration
- ✓NOAA / BGS World Magnetic Model (WMM) declination correction
- ✓Verification against astronomical solar transit observations (Rasd al-Qibla)
Ready to Check Your Exact Qibla Right Now?
Put these principles into action with our live 360° sensor compass, interactive geodesic satellite map, or AR camera scanner.
Related Guides & Fiqh Articles
View all →How Accurate is Qibla Finder? Geodesic Algorithms, Compass Sensors, and Fiqh Margins
An authoritative, scientific, and juristic investigation into the accuracy of online Qibla finders—analyzing great-circle spherical geodesy (WGS-84), smartphone sensor biases, magnetic interference, and classical Islamic standards.
Islamic Astronomy & FalakHow to Find Qibla Direction Using the Sun and Shadow (The Rasd al-Qibla Method)
Discover the 100% astronomically accurate method to determine the Kaaba's direction using solar shadows, both during the bi-annual Rasd al-Qibla zenith and through daily solar calculations.
Islamic Jurisprudence (Fiqh)The Fiqh of Facing the Qibla (Istiqbal al-Qibla): Rules, Allowances, and Mistakes
A thorough juristic examination of the requirement to face the Kaaba in Salah, covering the legal difference between direct line of sight vs general direction, and how to rectify mistakes.