Pregnancy Due Date Calculator (Naegele) Formula
Understand the math behind the pregnancy due date calculator (naegele). Each variable explained with a worked example.
Formulas Used
Current Gestational Week
gestational_weeks = floor(lmp_days_ago / 7)Extra Days
gestational_days_extra = lmp_days_ago - floor(lmp_days_ago / 7) * 7Days Until Due Date
days_remaining = max(280 - lmp_days_ago, 0)Weeks Remaining
weeks_remaining = max(280 - lmp_days_ago, 0) / 7Variables
| Variable | Description | Default |
|---|---|---|
lmp_days_ago | Days Since Last Period Started(days) | 84 |
How It Works
Naegele's Rule
The estimated due date is 280 days (40 weeks) from the first day of the last menstrual period (LMP).
Due Date = LMP + 280 days
Trimester Breakdown
| Trimester | Weeks | |---|---| | First | 1-12 | | Second | 13-27 | | Third | 28-40 |
Only about 5% of babies are born on their exact due date. Most arrive within 2 weeks of the estimate.
Worked Example
A woman whose last period started 84 days ago.
lmp_days_ago = 84
- 01Gestational week = floor(84 / 7) = 12 weeks
- 02Extra days = 84 - 12 x 7 = 0
- 03Days remaining = 280 - 84 = 196 days
- 04Weeks remaining = 196 / 7 = 28.0 weeks
Ready to run the numbers?
Open Pregnancy Due Date Calculator (Naegele)