Pregnancy Due Date Calculator Formula
Understand the math behind the pregnancy due date calculator. Each variable explained with a worked example.
Formulas Used
Weeks Remaining
weeks_remaining = floor(days_remaining / 7)Days Remaining
days_remain = days_remainingCurrent Trimester
trimester = weeks_pregnant < 13 ? 1 : (weeks_pregnant < 27 ? 2 : 3)Pregnancy Progress
progress_pct = total_days_pregnant / 280 * 100Variables
| Variable | Description | Default |
|---|---|---|
weeks_pregnant | Weeks Pregnant(weeks) | 12 |
days_extra | Extra Days(days) | 0 |
total_days_pregnant | Derived value= weeks_pregnant * 7 + days_extra | calculated |
days_remaining | Derived value= 280 - total_days_pregnant | calculated |
How It Works
Pregnancy Duration
A typical pregnancy lasts 40 weeks (280 days) from the first day of the last menstrual period (LMP).
Trimesters
| Trimester | Weeks | |---|---| | First | 1-12 | | Second | 13-26 | | Third | 27-40 |
Worked Example
A woman who is 12 weeks and 0 days pregnant.
weeks_pregnant = 12days_extra = 0
- 01Total days pregnant = 12 x 7 + 0 = 84 days
- 02Days remaining = 280 - 84 = 196 days
- 03Weeks remaining = floor(196 / 7) = 28 weeks
- 04Progress = 84 / 280 x 100 = 30.0%
Ready to run the numbers?
Open Pregnancy Due Date Calculator