Calculates wake-up times if you head to sleep this minute (includes 15 mins to fall asleep).
You should try to fall asleep at:
These times allow for 90-minute sleep cycles and include 15 minutes to fall asleep.
How to Use This Sleep Calculator
Waking up in the middle of a sleep cycle often results in "sleep inertia," leaving you feeling groggy and tired. This calculator uses the science of 90-minute sleep cycles to help you wake up at the end of a cycle, ensuring you feel refreshed.
Age Group
Recommended Sleep
Newborns (0-3 mo)
14 – 17 hours
Toddlers (1-2 yrs)
11 – 14 hours
School Age (6-13 yrs)
9 – 11 hours
Adults (18-64 yrs)
7 – 9 hours
function updateRecommendations() {
var age = document.getElementById('userAge').value;
var note = document.getElementById('ageRequirement');
var text = "";
switch(age) {
case "infant": text = "Recommended sleep: 12 to 15 hours (including naps)"; break;
case "toddler": text = "Recommended sleep: 11 to 14 hours (including naps)"; break;
case "preschool": text = "Recommended sleep: 10 to 13 hours"; break;
case "school": text = "Recommended sleep: 9 to 11 hours"; break;
case "teen": text = "Recommended sleep: 8 to 10 hours"; break;
case "adult": text = "Recommended sleep: 7 to 9 hours"; break;
case "senior": text = "Recommended sleep: 7 to 8 hours"; break;
}
note.innerText = text;
}
function formatTime(date) {
var hours = date.getHours();
var minutes = date.getMinutes();
var ampm = hours >= 12 ? 'PM' : 'AM';
hours = hours % 12;
hours = hours ? hours : 12;
minutes = minutes < 10 ? '0' + minutes : minutes;
return hours + ':' + minutes + ' ' + ampm;
}
function calculateBedtime() {
var h = parseInt(document.getElementById('wakeHour').value);
var m = parseInt(document.getElementById('wakeMinute').value);
var ampm = document.getElementById('wakeAMPM').value;
if (ampm === "PM" && h < 12) h += 12;
if (ampm === "AM" && h === 12) h = 0;
var wakeDate = new Date();
wakeDate.setHours(h, m, 0, 0);
// If the time is already past for today, assume tomorrow
var now = new Date();
if (wakeDate <= now) {
wakeDate.setDate(wakeDate.getDate() + 1);
}
var results = [];
var cycleMinutes = 90;
var fallingAsleepBuffer = 15;
// Calculate 6, 5, and 4 cycles back
var cycles = [6, 5, 4];
var container = document.getElementById('timeOptions');
container.innerHTML = "";
for (var i = 0; i < cycles.length; i++) {
var bedTime = new Date(wakeDate.getTime() – (cycles[i] * cycleMinutes * 60000) – (fallingAsleepBuffer * 60000));
var timeStr = formatTime(bedTime);
var span = document.createElement('span');
span.className = "cycle-time";
span.innerText = timeStr;
container.appendChild(span);
var label = document.createElement('div');
label.style.fontSize = "12px";
label.style.color = "#065f46";
label.style.marginBottom = "10px";
label.innerText = "(" + cycles[i] + " Cycles — " + (cycles[i] * 1.5) + " hours of sleep)";
container.appendChild(label);
}
document.getElementById('resultTitle').innerText = "To wake up refreshed at " + formatTime(wakeDate) + ", go to bed at:";
document.getElementById('sleepResult').style.display = "block";
document.getElementById('sleepResult').scrollIntoView({ behavior: 'smooth' });
}
function calculateWakeupTime() {
var now = new Date();
var fallingAsleepBuffer = 15;
var startTime = new Date(now.getTime() + (fallingAsleepBuffer * 60000));
var cycleMinutes = 90;
var container = document.getElementById('timeOptions');
container.innerHTML = "";
// Calculate forward for 6, 5, and 4 cycles
var cycles = [4, 5, 6];
for (var i = 0; i < cycles.length; i++) {
var wakeTime = new Date(startTime.getTime() + (cycles[i] * cycleMinutes * 60000));
var timeStr = formatTime(wakeTime);
var span = document.createElement('span');
span.className = "cycle-time";
span.innerText = timeStr;
container.appendChild(span);
var label = document.createElement('div');
label.style.fontSize = "12px";
label.style.color = "#065f46";
label.style.marginBottom = "10px";
label.innerText = "(" + cycles[i] + " Cycles — " + (cycles[i] * 1.5) + " hours of sleep)";
container.appendChild(label);
}
document.getElementById('resultTitle').innerText = "If you go to bed now, try to wake up at:";
document.getElementById('sleepResult').style.display = "block";
document.getElementById('sleepResult').scrollIntoView({ behavior: 'smooth' });
}
The Science of Sleep Cycles
Human sleep is not a uniform state of rest. Instead, we progress through several stages of sleep that repeat throughout the night. A full cycle typically lasts about 90 minutes.
Why the 90-Minute Rule Matters
Each sleep cycle consists of Light Sleep, Deep Sleep, and REM (Rapid Eye Movement) sleep. If you wake up during a deep sleep phase, you will likely feel groggy, confused, and irritable. This is known as sleep inertia. By timing your alarm to coincide with the end of a 90-minute cycle, you are waking up during light sleep, which mimics your natural waking process.
Optimal Sleep by Age
While the 90-minute cycle is consistent for most adults, the total amount of sleep needed varies significantly by age:
Infants (4-11 months): Need 12-15 hours. Sleep architecture is still developing.
Teens (14-17 years): Need 8-10 hours. Biological sleep patterns shift later during puberty.
Adults (18-64 years): The "gold standard" is 7-9 hours, which equals 5 to 6 full sleep cycles.
Seniors (65+): Need 7-8 hours. Sleep may become lighter and more fragmented.
Tips for Better Sleep Quality
1. Consistency: Go to bed and wake up at the same time every day, even on weekends.
2. The 15-Minute Rule: Most people take about 14-20 minutes to fall asleep. Our calculator automatically adds a 15-minute buffer to your calculations.
3. Limit Blue Light: Avoid screens (phones, tablets, TVs) at least 60 minutes before your calculated bedtime.