Menstrual Cycle Length Tracker Formula
Understand the math behind the menstrual cycle length tracker. Each variable explained with a worked example.
Formulas Used
Days Until Next Period
next_period_in = max(cycle_length - days_since_period, 0)Current Cycle Day
current_phase = days_since_periodOvulation Expected on Day
ovulation_day_display = ovulation_dayPMS Window Starts Day
pms_starts_day = cycle_length - 7Variables
| Variable | Description | Default |
|---|---|---|
cycle_length | Average Cycle Length(days) | 28 |
period_length | Period Duration(days) | 5 |
days_since_period | Days Since Last Period Started(days) | 15 |
ovulation_day | Derived value= cycle_length - 14 | calculated |
How It Works
Menstrual Cycle Phases
Typical 28-Day Cycle
| Phase | Days | Description | |---|---|---| | Menstruation | 1-5 | Period bleeding | | Follicular | 1-13 | Follicle development | | Ovulation | ~14 | Egg release | | Luteal | 15-28 | Post-ovulation | | PMS Window | ~21-28 | Premenstrual symptoms |
Next Period = Cycle Length - Days Since Last Period Ovulation Day = Cycle Length - 14
Worked Example
A 28-day cycle, period lasts 5 days, currently on day 15.
cycle_length = 28period_length = 5days_since_period = 15
- 01Next period in = 28 - 15 = 13 days
- 02Ovulation day = 28 - 14 = Day 14 (just passed)
- 03PMS window starts = Day 21 (in 6 days)
Ready to run the numbers?
Open Menstrual Cycle Length Tracker