Muslim Expert Logo Muslim Expert
Muslim Expert
prayer time calculation spherical trigonometry prayer calculation methods solar depression angle fajr salat islamic astronomy

How Are Islamic Prayer Times Calculated?

Mosque silhouette against an orange sunset sky illustrating the astronomical calculation of Islamic prayer times.

The first computerized algorithm for calculating prayer times dates back to 1978. Before that, muezzins had observed the sky by eye for 14 centuries. Today, two apps can display different times for the same mosque in the same city. That gap can exceed 48 minutes depending on the calculation method chosen (Fiqh Council of North America, 2024). This article explains why, tracing the full path from astronomy to modern apps, step by step.

For a broader overview, read our complete guide to Islamic prayer times.

Key Takeaways

  • The 5 prayers correspond to 5 precise positions of the sun along its apparent path.
  • There are 22 officially recognized calculation methods (Al-Adhan API, 2024), with Fajr angles ranging from 12° to 20°.
  • The same location can have prayer times that differ by up to 48 minutes depending on the method used.
  • Asr (afternoon) is the exception: its calculation uses a shadow rule, not a solar angle.
  • Beyond 48°N in summer, standard formulas have no mathematical solution.

What Is the Astronomical Principle Behind Prayer Times?

The 5 prayers correspond to 5 precise solar positions along the sun's apparent path across the sky. The Fajr (dawn) angle alone varies from 12° to 20° depending on the adopted calculation method (Praytimes.org, 2024). That single variable creates the majority of differences you see between apps.

Here are the astronomical definitions for each prayer:

Prayer Astronomical Definition
Fajr (dawn) Sun at a negative angle of 12° to 20° below the horizon
Dhuhr (noon) Sun at the local meridian (true solar noon)
Asr (afternoon) Specific shadow length based on legal school
Maghrib (sunset) Sun at the horizon (apparent sunset, corrected by 0.833°)
Isha (night) Sun at a negative angle of 15° to 18° below the horizon

The Quran refers to the prayers through natural markers: "Perform the prayer at the sun's decline until the darkness of the night, and the recitation of dawn" (Quran 17:78). Muslim astronomers then translated those markers into precise angular measurements.

Jama Masjid mosque in Delhi with thousands of worshippers gathered for prayer under golden afternoon light

Citation capsule The times of the 5 Islamic prayers are defined by precise angular positions of the sun below the horizon. The Fajr angle ranges from 12° to 20° depending on the adopted method, creating gaps of up to 48 minutes between two calculations for the same location (Praytimes.org, 2024; Fiqh Council of North America, 2024).


How Does Spherical Trigonometry Apply to Prayer Calculation?

Calculating a prayer time relies on a spherical trigonometric formula. It takes your latitude, your longitude, the day's solar declination, and the target angle as inputs. The result gives the exact time at which the sun reaches that angle, in corrected local time (Praytimes.org, 2024).

The key variables in the formula are:

  • Latitude (φ): your north-south position on the globe
  • Solar declination (δ): the sun's tilt relative to the equator, which changes daily
  • Hour angle (H): the angle between the local meridian and the sun
  • Target angle (α): the angle below the horizon being aimed for (e.g., -18° for Isha)

The central formula is: cos(H) = (sin(α) - sin(φ) × sin(δ)) / (cos(φ) × cos(δ))

Two corrections that are often overlooked significantly change the final result. Atmospheric refraction adds 0.833° to the sun's apparent angle at the horizon (Praytimes.org, 2024): the sun appears to have already risen even when it is still geometrically below the horizon. The Equation of Time, for its part, varies from -14 to +16.5 minutes depending on the month, because the Earth does not orbit the Sun at a constant speed. Without both corrections, your prayer times would be off by several minutes every single day.

From the Muezzin to the App: 14 Centuries of Calculation 7th c. Muezzins naked eye 9th c. Al-Khwarizmi trigonometry 14th c. Ibn al-Shatir Zij tables 1978 Kamal Abdali Unix algorithm 2010 First GPS apps mobile 2024 22+ methods real-time GPS Sources: PrayTimes.org, GitHub KamalAbdali/minaret
Timeline of Islamic prayer time calculation, from the 7th century to today. Sources: PrayTimes.org, GitHub KamalAbdali/minaret.

Citation capsule Spherical trigonometry calculates the exact time at which the sun reaches a given angle below the horizon. Two corrections are essential: atmospheric refraction (0.833°) and the Equation of Time (-14 to +16.5 min depending on the month). Without both, prayer times would be wrong by several minutes (Praytimes.org, 2024).


Why Do 22 Different Calculation Methods Exist?

There are 22 officially recognized calculation methods (Al-Adhan API, 2024). The gap between a 12° method and a 20° method can reach 48 minutes for the same location (Fiqh Council of North America, 2024). That disagreement is not astronomical — it's jurisprudential.

The mathematical formula is the same for everyone. What varies is the target angle chosen to define "dawn" (Fajr) and "night" (Isha). Each Islamic school or organization has interpreted the prophetic description of those moments differently: "until the white thread becomes distinct from the black thread at dawn" (Quran 2:187, scholarly interpretation). This diversity of interpretation is a classic example of ikhtilaf (legitimate scholarly disagreement).

The 5 most widely used methods in the world:

Method Organization Fajr Angle Isha Angle Main Region
MWL Muslim World League 18° 17° Europe, Asia
ISNA Islamic Society of North America 15° 15° North America
Egypt (EGAS) Egyptian General Authority of Survey 19.5° 17.5° Arab world
Singapore (MUIS) Islamic Religious Council of Singapore 20° 18° Southeast Asia
Muslims of France (UOIF) Union of Islamic Organizations 12° 12° France
Fajr Angle by Calculation Method Singapore (MUIS) 20° Egypt (EGAS) 19.5° MWL (Muslim World League) 18° Karachi (UISK) 18° Russia (SAMR) 16° ISNA (North America) 15° Source: Al-Adhan.com, 2024 — Fajr angles by official method
Comparison of Fajr angles by official calculation method. The UOIF method used in France (12°) is not shown here for readability. Source: Al-Adhan.com, 2024.

Compass held in a hand, symbolizing the precision of prayer direction (Qibla) calculation

Citation capsule All 22 recognized calculation methods (Al-Adhan API, 2024) use the same trigonometric formula. The disagreement concerns the angle defining dawn and night, a jurisprudential choice rather than an astronomical one. For the same location, that gap can reach 48 minutes (Fiqh Council of North America, 2024).


How Is Asr Calculated? The Special Case

Asr (afternoon) is the only prayer whose calculation does not rely on a solar angle. It relies on a shadow rule instead. The Shafi'i school (and Maliki, Hanbali) holds that Asr begins when an object's shadow equals its own height. The Hanafi school waits until the shadow equals twice the object's height. That difference can reach 20 to 45 minutes depending on the season and latitude.

The mathematical formula is:

cot(Asr) = tan|φ - δ| + n

Here, φ is the latitude, δ is the solar declination for the day, and n equals 1 for the Shafi'i school or 2 for the Hanafi school.

[PERSONAL EXPERIENCE] In concrete implementations, this parameter is often labeled "madhab" or "school" in prayer calculation APIs. It takes the value 0 (Shafi'i) or 1 (Hanafi). Both positions are valid within their respective contexts: this is a well-documented example of ikhtilaf (legitimate scholarly disagreement) that has been recognized for centuries. We present both without taking sides.

Citation capsule Asr is calculated using a shadow rule, not a solar angle. The Shafi'i school applies cot(Asr) = tan|φ - δ| + 1, while the Hanafi school uses cot(Asr) = tan|φ - δ| + 2. The difference between the two can reach 45 minutes depending on the season (Praytimes.org, 2024).


Why Do My App and the Mosque Show Different Times?

Three causes explain nearly every gap between an app and your local mosque. First, the calculation method used may differ. Second, the mosque sometimes applies local adjustments of a few minutes. Third, even with the same method, two software implementations can differ by 1 to 5 minutes (Al-Adhan.com, 2024).

The first step is simple: ask your mosque which calculation method it uses and whether it applies any manual adjustments. That information alone explains almost all the differences you'll encounter.

[ORIGINAL DATA] In our tests across several cities, we found that mosques rarely communicate their exact settings. Most use either an 18° or 12° method, but often add local adjustments of +5 to +10 minutes on specific prayers for practical reasons like the call to prayer and community scheduling.

Muslim Expert offers more than 15 configurable calculation methods, with per-prayer minute adjustments and automatic high-latitude handling. You can sync your times precisely with your mosque.

Citation capsule Gaps between apps and mosques have three root causes: different calculation methods, local adjustments, and software rounding variations (1 to 5 minutes for the same method, Al-Adhan.com, 2024). The solution is to ask your mosque for its exact method and any adjustments, then configure your app accordingly.


How Do High Latitudes Complicate the Calculation?

Beyond 48°N in summer, the standard trigonometric formula has no valid mathematical solution. The sun never dips low enough below the horizon to reach certain target angles. Researchers have identified three alternative algorithms to address this problem (The Arctic Institute, 2023).

The three commonly used solutions are:

  • The midnight rule: the interval between solar noon and midnight is divided proportionally to estimate the missing time.
  • The 1/7 night rule: the night is divided into 7 equal parts, with Fajr starting at the 1st part and Isha at the 7th.
  • The nearest city method: times from a city at a "normal" latitude in the same time zone are used instead.

Every mosque in Northern Europe, Canada, or Scandinavia faces this problem for several months each year. There is no universal consensus on the best solution. It's another area of ikhtilaf among contemporary scholars.

Citation capsule Beyond 48° north latitude in summer, the trigonometric prayer calculation formula has no solution. Three alternative methods are used: the midnight rule, the 1/7 night rule, and the nearest city method. None has achieved universal Islamic consensus (The Arctic Institute, 2023).


How Does Muslim Expert Calculate Your Prayer Times?

Muslim Expert uses your real-time GPS position to feed directly into the trigonometric formulas, with no approximate rounding. The world's 2 billion Muslims have very different needs depending on where they live (Pew Research Center, 2025): that's why the app offers more than 15 calculation methods.

Here's what the app calculates for you:

  • Precise GPS: exact coordinates, not a rounded city center
  • 15+ methods: MWL, ISNA, Egypt, Singapore, UOIF, Karachi, and all Al-Adhan recognized methods
  • Per-prayer adjustments: add or subtract minutes for each individual salat
  • Automatic high-latitude handling: detection and automatic switch to the appropriate algorithm for your position
  • Asr calculation: choose between the Shafi'i school (n=1) and the Hanafi school (n=2)

Want times that match your mosque? Download the app, select your mosque's method, and fine-tune it minute by minute: get.muslim-expert.app.


Frequently Asked Questions

What Is the Difference Between Fajr and Astronomical Dawn?

Astronomical dawn begins when the sun is at -18° below the horizon, which marks the complete end of darkness. Islamic Fajr (dawn) is calculated with an angle of 12° to 20° depending on the method, corresponding to the appearance of the "white light" on the horizon described in the texts. Astronomical dawn always precedes Islamic Fajr by anywhere from a few minutes to several tens of minutes.

Why Do My App and the Mosque Show Different Times?

Three reasons are possible. The calculation method may differ (for example, UOIF vs MWL, a gap of up to 48 min). The mosque may apply local adjustments of a few minutes. Or the two pieces of software may round slightly differently (1 to 5 min for the same method, Al-Adhan.com, 2024). Ask your mosque for its exact method.

How Is Solar Noon (Dhuhr) Calculated?

Dhuhr (noon) corresponds to the sun's passage through the local meridian, known as "true solar noon." It is calculated from your position's longitude and the day's Equation of Time, which varies from -14 to +16.5 minutes depending on the month (Praytimes.org, 2024). It is almost never at 12:00 on your clock.

What Is Atmospheric Refraction in Prayer Calculation?

The atmosphere bends the sun's light rays, which means you can still see the sun above the horizon even after it has geometrically passed below it. This correction is fixed at 0.833° for calculating sunrise and sunset (Praytimes.org, 2024). Without it, Maghrib would be calculated a few minutes too early.

Can I Calculate My Prayer Times Manually?

Yes, with a scientific calculator. You need: your latitude, your longitude, the day of the year (to obtain the solar declination and Equation of Time), and the target angle for your method. The formula cos(H) = (sin(α) - sin(φ) × sin(δ)) / (cos(φ) × cos(δ)) gives you the hour angle, which you can convert to local time. The first person to automate this calculation was S. Kamal Abdali in 1978 (GitHub: KamalAbdali/minaret).


Conclusion

Behind every prayer notification lies 14 centuries of transmission: from observing the sky by naked eye in the 7th century, to the astronomical tables of Ibn al-Shatir in the 14th century, to the first computerized algorithm by Kamal Abdali in 1978. Today, 22 calculation methods coexist, reflecting the richness of Islamic ikhtilaf on how to interpret the natural markers found in the Quran and Sunnah.

The science behind your prayer times is rigorous and precise. The differences you notice between sources are not errors. They reflect legitimate, well-documented scholarly choices made over centuries.

To go further and configure your app to match your mosque's method, download Muslim Expert at get.muslim-expert.app.


Muslim Expert Logo Muslim Expert

The most completely featured app for your daily spiritual life.

Prayer times in every countries. Find your city

© 2026 Muslim Expert — Liftoff. All rights reserved.