Pregnancy Calculator
Calculate estimated due date and gestational age from the last menstrual period using Naegele's rule.
Once a test shows two lines, the next questions are the due date and how far along things are. The clinical calculation starts from the first day of the last menstrual period rather than the conception date, and runs a full 280 days. Enter the date to see the current gestational age, which stage of pregnancy that falls in and how long is left — with a note below on cycles longer or shorter than usual.
On the conventions: when cycles are irregular, far from 28 days, or the last period cannot be recalled, Naegele's rule carries a large error, and gestational age is confirmed from an early scan measuring crown-rump length; if the scan differs from the period-based dating by more than five to seven days, the clinician revises the due date accordingly.
Did this tool solve your problem?
Submitting sends the tool name, your input and the current result to the server. Please do not include ID numbers, phone numbers or other private data.
AI assistant It answers using your current input and result
Asking again sends your current input and result to the server once more. Please do not include private data.
How to use
- Enter the first day of the last menstrual period.
- Read the due date and the current gestational age.
- Check which trimester that falls in.
- Expect the dating to be revised by an early scan if cycles are irregular.
How it works
Last menstrual period and conception date
Enter the first day of your last menstrual period (this is the starting point, not the conception date — conception usually occurs about 2 weeks after the LMP).
How to choose the base date
The base date defaults to today and can be changed to any date to see the gestational age on that day.
Gestational weeks and due date
Due date = LMP + 280 days. The first trimester is 1-13+6 weeks, the second 14-27+6 weeks, and the third from 28 weeks.
Code example
JavaScript Naegele's rule
const DAY = 86400000;
function pregnancy(lmp, base = new Date()) {
const t = new Date(lmp).getTime();
const days = Math.floor((base - t) / DAY);
const week = Math.floor(days / 7);
return {
edd: new Date(t + 280 * DAY), // due date
gestational: week + "w + " + (days % 7) + "d",
trimester: days < 84 ? "first" : days < 196 ? "second" : "third"
};
}
Python The same formulas in Python
from datetime import date, timedelta
def pregnancy(lmp, base=None):
t = date.fromisoformat(lmp)
base = base or date.today()
days = (base - t).days
return {"edd": t + timedelta(days=280),
"gestational": f"{days // 7}w + {days % 7}d",
"trimester": "first" if days < 84 else "second" if days < 196 else "third"}
# Naegele's rule, +280 days; with irregular cycles trust an early ultrasound
FAQ
How is the due date computed?
Naegele's rule: first day of the LMP + 280 days (40 weeks). This is the global estimation method used in prenatal checkups. In reality only about 5% of babies are born exactly on the due date; most arrive between 37-42 weeks, and within two weeks either side is normal full-term.
What if my periods are irregular?
With irregular cycles or an uncertain LMP the formula may err by 1-2 weeks. The most reliable method is an early-pregnancy (before 11-13+6 weeks) ultrasound measuring crown-rump length (CRL) to verify gestational age, by which the doctor corrects the due date.
Is gestational age the same as the fetus's actual size?
No. Gestational age is counted from the LMP and includes about 2 weeks before conception; the fetus's actual development time (fetal age) is about 2 weeks less. "Week X" on checkup reports always refers to gestational age, as does this tool.
From which day do gestational weeks start?
From the first day of the LMP, not the conception date. Because conception usually occurs about 2 weeks after the LMP, medical gestational age is roughly two weeks more than actual conception time, with the whole pregnancy counted as 40 weeks.
Is the due date generally accurate?
Only about 5% of babies are born exactly on it; most arrive within 2 weeks either side, and 37-41 weeks is full-term. The due date mainly schedules checkups and judges the growth pace — don't over-worry about a few days early or late.
How are the first, second and third trimesters divided?
Common division: first trimester 0-13 weeks, second 14-27 weeks, third from 28 weeks to delivery. The first is the key period for organ development with the most tests and precautions; the third focuses on fetal movement, position and signs of labor.
The ultrasound gestational age differs from the LMP-based one — which applies?
An early-pregnancy (especially before 12 weeks) ultrasound by CRL is most accurate. If it differs from the LMP-based result by more than 5-7 days, doctors usually correct the due date by the ultrasound; those with irregular cycles should especially reference the early ultrasound.
Is private information like the LMP uploaded?
No. The date is used only in the browser for projection, not sent to a server or stored; we can't see what you enter. If you use history, records stay only in your browser and are clearable in one click. You can also always use incognito mode to leave no trace on close.