Tool from Miqat
Islamic Midnight and Tahajjud Time Calculator
Type Maghrib, Fajr and, if you want the second convention, sunrise, as printed on your mosque timetable or app. The page divides the night and shows midnight and the start of the last third, with who holds each method. No location is asked for.
How the night is divided
The sources below all start the night at sunset and cut it into equal parts. The calculator does the same arithmetic. The night is the time from Maghrib forward to Fajr (or to sunrise). If Fajr is a smaller clock number than Maghrib, the night crosses midnight on the clock and 24 hours are added. Maghrib 21:20 and Fajr 02:50 is a night of 5 h 30 min.
Two ways to find midnight
Sunset to Fajr. IslamQA answer 9940 says the time for Isha lasts until midnight, and that to find midnight you calculate the time between sunset and the break of true dawn (when Fajr begins) and divide it in half. It says the calculation uses Fajr, not sunrise. Its examples: sunset at 5 pm and Fajr at 5 am give midnight at 11 pm; Fajr at 6 am gives 11:30 pm. PrayTimes.org gives the same formula and calls it the "legal" midnight, the ending time for Isha: Sunset + 1/2 (Fajr - Sunset).
Sunset to sunrise. In AMJA fatwa 87614 (Dr. Hatem al-Haj, 19 October 2012) midnight is found by determining the midpoint between sundown and sunrise. PrayTimes.org calls this astronomical midnight: Sunset + 1/2 (Sunrise - Sunset). The two conventions give different clock times because sunrise comes after Fajr.
The last third of the night
Darul Ifta Birmingham (answer by Maulana Abdul Malik, checked by Mufti Mohammed Tosir Miah) says to calculate the time between sunset and the break of dawn and divide it into three equal portions. The final portion is the last third. Its example: if sunset to dawn is 9 hours, the last third begins 3 hours before dawn. Try it above with Maghrib 20:00 and Fajr 05:00; the last third begins at 02:00.
The second block on this page applies the same one-third division to the sunset-to-sunrise night. That is our arithmetic for comparison. None of the four sources gives a last-third rule for it.
Worked example
Sample values: Maghrib 17:00, Fajr 05:00. The night is 12 hours. Half is 6 hours, so midnight is 23:00, matching IslamQA's example. A third is 4 hours, so the last third begins at 01:00. With sunrise at 06:30 the night to sunrise is 13 h 30 min, half is 6 h 45 min, so the sunrise convention gives 23:45.
Why your answer changes through the year
Sunset and dawn move through the year, so the night gets longer and shorter and midnight and the last third move with it. Type each day's times for each day. In northern summers the usual Fajr and Isha angles can stop working, which is covered in Isha and Fajr in summer at high latitudes. For how Fajr itself is defined, see prayer time calculation methods.
Where to get the input times
Use your local mosque timetable. Miqat also calculates prayer times for your place on your phone and has a monthly timetable, so you can copy Maghrib and Fajr from it. Miqat does not calculate midnight or the last third itself; this page does that division. The sources count from sunset, so if your Maghrib is a few minutes after sunset, the results move by up to half of that gap.
What it assumes
- You type times for one evening and the following morning.
- Sunrise is optional. Leave it empty and only the Maghrib to Fajr block is shown.
- Some scholars may measure the night differently. This page shows only the conventions named above.
- This is arithmetic on published conventions, not a religious ruling.
Sources
- IslamQA answer 9940, times of the five daily prayers
- Darul Ifta Birmingham, how to calculate tahajjud and the last third of the night
- AMJA fatwa 87614, the end time for Isha
- PrayTimes.org, calculation
Botsquash and Miqat are not affiliated with these sites.
Calculates the five daily prayer times on the phone, with alerts, a Qibla compass and the Qur'an.
Get it on Google PlayFree with a small banner ad on the Zakat, Monthly timetable, More and Settings screens only. One optional one-time purchase unlocks the memorisation companion and also removes the banner. There is no subscription.