How We Calculate Tahajjud Time

One paragraph: the Islamic night runs from Maghrib to Fajr. We measure that night, divide it into three equal parts, and the final part is the last third — the Tahajjud window. Islamic midnight is the same night's halfway point. Everything on this site hangs on those two definitions, and this page shows the working, the methods underneath, and the sources.

To see it live before reading on, open the tahajjud calculator — it does this arithmetic for your city in about a second.

Diagram of the night from sunset to dawn divided into three equal parts for calculating Tahajjud time

The formula, with the worked example

Step 1 — Night length. Tomorrow's Fajr minus today's Maghrib. Step 2 — One third. Night length ÷ 3. Step 3 — Last third begins. Maghrib + 2 thirds (equivalently, Fajr − 1 third). It ends at Fajr. Islamic midnight = Maghrib + (night length ÷ 2).

With Maghrib at 6:12 PM and Fajr at 5:24 AM: the night is 11 hr 12 min, each third is 3 hr 44 min, the last third begins at 1:40 AM, and Islamic midnight is 11:48 PM. Two display rules protect the result: the last-third start is always rounded up to the next minute, so we never tell you to begin before the third has truly started; and Fajr is always shown as the hard end deadline. Every result also prints the method used and a ±1 minute note.

Where the prayer times come from

Maghrib and Fajr are computed in your browser, on your device, from astronomical formulas — the position of the sun for your exact coordinates and date, worked through the standard solar-position and hour-angle equations that the established prayer-time libraries use. This site ships with its own self-contained implementation of those algorithms; there is no prayer-time API behind it, no server call, and no timetable that expires. The computation runs on two dates — today for Maghrib and Isha, tomorrow for Fajr — and converts the results into your place's IANA timezone, so daylight-saving changes are handled by the timezone data itself, never by hand-adjusted offsets.

Before launch, we cross-checked this calculator's Maghrib and Fajr against published timetable values for a spread of cities and methods — Karachi, Makkah, Dubai, London, New York, Toronto, Sydney and Jakarta — and every pair matched within a minute. We still print the honest label on every result: calculated estimates, ±1 minute, for planning — your mosque's timetable is the authority for congregation times.

The calculation methods we support

A "method" is mainly a choice of sun angle for Fajr (and Isha): the deeper the sun must be below the horizon, the earlier Fajr falls. That single choice is why two good sources can disagree by ten or twenty minutes.

MethodTypically used in
Muslim World League (MWL)Europe, much of the world — our global default
Islamic Society of North America (ISNA)United States, Canada
Egyptian General Authority of SurveyEgypt, parts of Africa and the Middle East
Umm al-Qura University, MakkahSaudi Arabia
University of Islamic Sciences, KarachiPakistan, Bangladesh, India, Afghanistan
Jafari — Shia Ithna-Ansari (Leva Research Institute, Qum)Shia communities
Institute of Geophysics, University of TehranIran
Gulf RegionUAE, Gulf states
KuwaitKuwait
QatarQatar
Majlis Ugama Islam Singapura (MUIS)Singapore
Union Organization islamic de France (UOIF)France
Diyanet İşleri BaşkanlığıTurkey
Spiritual Administration of Muslims of RussiaRussia
DubaiDubai, UAE

Where the sun never reaches the method's Fajr angle — high-latitude summer nights — the calculator applies a standard portion-of-the-night adjustment and says so on the result. An adjusted time is never quietly presented as a plain one, and the standing advice for those dates is to follow your local mosque's timetable. And if a result truly cannot be computed, the tool tells you and points you to manual entry rather than guessing.

Why the night ends at Fajr, not sunrise

True dawn — the first horizontal light of Fajr — is the boundary the Quran and Sunnah draw: eating and the night's worship run "until the white thread of dawn becomes distinct from the black thread" (Quran 2:187, in meaning). Sunrise is a later event that ends the Fajr prayer's time; it has never bounded the night. At least one widely-ranking calculator makes exactly this mistake, asking for sunset and sunrise — which stretches the "night" by an hour or more and drags the last third later with it. Our night ends at Fajr on every method, every date, every city. No exceptions.

Islamic midnight — our definition

We define Islamic midnight as Maghrib + half the Maghrib-to-Fajr night, and we compute it ourselves from those two times. We deliberately never read a "midnight" value out of a calculation library, because library conventions vary — some define the midpoint from sunset to sunrise. Ours is Maghrib to Fajr, always, for the reasons in the section above. The Islamic midnight calculator is built entirely on this definition.

Sources

  • The last-third hadith: Sahih al-Bukhari 1145; Sahih Muslim 758.
  • Quran: 17:79 (the command and the praised station), 32:16 (forsaking their beds), 51:18 (seeking forgiveness before dawn), 73:6 (the night's impression on speech), 2:187 (the dawn boundary).
  • The computation: standard solar-position astronomy as implemented by the established open-source prayer-time libraries, with method parameter sets as tabled above; timezone handling from IANA timezone data; Hijri dates from the platform's Islamic calendar.

The standing note, one more time: these are careful estimates for planning. If your local mosque or a trusted local timetable gives a different time, follow your local mosque.

Frequently asked questions

How is Tahajjud time calculated?

Take the night from Maghrib to the next Fajr, divide its length by three, and count two thirds forward from Maghrib. That point is where the last third begins; it ends at Fajr. Islamic midnight is the same night's halfway point: Maghrib plus half the night.

Why does the night end at Fajr and not sunrise?

Because the Islamic night is defined by true dawn. Fajr is the first light of dawn; sunrise comes later and ends Fajr prayer's own time instead. Running the night to sunrise — as some calculators do — stretches the night by an hour or more and moves the last third with it.

Why do different apps show different Tahajjud times?

Usually because they use different calculation methods: the sun angle chosen for Fajr differs by organisation (18° for the Muslim World League, 15° for ISNA, and so on), so Fajr itself — and everything counted from it — shifts. Choose the method your mosque follows, or enter your mosque's times directly.

Does the calculator send my location anywhere?

No. The calculation runs entirely in your browser from your coordinates; nothing is sent to a server. Your last place and method are stored only on your own device so the tool opens ready on your next visit, and you can clear them at any time through your browser settings.

Related tools and guides