Use this calculator to determine your current gestational age, estimated due date, and trimester based on your Last Menstrual Period (LMP) or an already known Estimated Due Date (EDD).
Calculate from Last Menstrual Period (LMP)
Calculate from Estimated Due Date (EDD)
Understanding Your Pregnancy Weeks
Knowing your gestational age is crucial for tracking your baby's development, scheduling prenatal appointments, and preparing for birth. This calculator provides an estimate based on common medical guidelines.
How Pregnancy Weeks Are Counted
Pregnancy is typically counted from the first day of your Last Menstrual Period (LMP), even though conception usually occurs about two weeks later. This method is used because the LMP is often a more reliable and easily identifiable date than the exact date of conception. A full-term pregnancy is considered to be 40 weeks (280 days) from the LMP.
Using the Calculator
From Last Menstrual Period (LMP): If you know the first day of your last period, enter it into the designated field. The calculator will then estimate your current gestational age, your estimated due date (EDD), and your current trimester.
From Estimated Due Date (EDD): If you've already had an ultrasound or your doctor has provided an estimated due date, you can enter that date. The calculator will then work backward to estimate your LMP and provide your current gestational age and trimester.
Trimesters Explained
Pregnancy is divided into three trimesters, each lasting approximately three months or 13-14 weeks. These divisions help healthcare providers monitor specific developmental milestones and potential risks.
First Trimester: Weeks 1-13. This period involves rapid cell division and organ formation.
Second Trimester: Weeks 14-27. The baby grows significantly, and many women feel the first movements.
Third Trimester: Weeks 28-40 (or birth). The baby continues to grow and mature, preparing for birth.
Important Considerations
While this calculator provides a good estimate, it's important to remember:
Ultrasound Accuracy: Early ultrasounds (especially between 8-12 weeks) are often considered the most accurate method for dating a pregnancy. Your doctor may adjust your due date based on ultrasound findings.
Cycle Length Variation: The 40-week calculation assumes a 28-day menstrual cycle with ovulation around day 14. If your cycles are significantly longer or shorter, your actual ovulation date might differ, affecting the accuracy of LMP-based dating.
Individual Variation: Babies rarely arrive exactly on their due date. Most full-term births occur between 37 and 42 weeks of gestation.
Examples:
Example 1: Calculating from LMP
If your Last Menstrual Period (LMP) started on January 1, 2024, and today's date is June 15, 2024:
The calculator would determine your Estimated Due Date (EDD) to be around October 8, 2024 (January 1 + 280 days).
Your current gestational age would be approximately 24 weeks and 0 days.
You would be in your Second Trimester.
Example 2: Calculating from EDD
If your doctor gave you an Estimated Due Date (EDD) of December 25, 2024, and today's date is June 15, 2024:
The calculator would work backward to estimate your LMP start date as around March 19, 2024 (December 25 – 280 days).
Your current gestational age would be approximately 12 weeks and 4 days.
You would be in your First Trimester.
function calculateFromLMP() {
var lmpDateStr = document.getElementById("lmpDate").value;
var resultDiv = document.getElementById("pregnancyResult");
resultDiv.innerHTML = ""; // Clear previous results
if (!lmpDateStr) {
resultDiv.innerHTML = "Please enter the First Day of your Last Menstrual Period.";
return;
}
var lmpDate = new Date(lmpDateStr + "T00:00:00"); // Ensure UTC to avoid timezone issues
var today = new Date();
today.setHours(0, 0, 0, 0); // Normalize today's date to start of day
if (lmpDate > today) {
resultDiv.innerHTML = "LMP date cannot be in the future. Please enter a valid date.";
return;
}
// Calculate Estimated Due Date (EDD)
// EDD = LMP + 280 days (40 weeks)
var edd = new Date(lmpDate);
edd.setDate(lmpDate.getDate() + 280);
// Calculate current gestational age
var diffTime = Math.abs(today.getTime() – lmpDate.getTime());
var diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
var currentWeeks = Math.floor(diffDays / 7);
var currentDays = diffDays % 7;
// Determine Trimester
var trimester = "";
if (currentWeeks >= 0 && currentWeeks = 14 && currentWeeks = 28) {
trimester = "Third Trimester";
} else {
trimester = "Not yet pregnant or invalid date range";
}
// Format dates for display
var options = { year: 'numeric', month: 'long', day: 'numeric' };
var lmpDisplay = lmpDate.toLocaleDateString('en-US', options);
var eddDisplay = edd.toLocaleDateString('en-US', options);
resultDiv.innerHTML =
"Based on your LMP of " + lmpDisplay + ":" +
"Your current gestational age is approximately: " + currentWeeks + " weeks and " + currentDays + " days" +
"Your Estimated Due Date (EDD) is: " + eddDisplay + "" +
"You are currently in your: " + trimester + "";
}
function calculateFromEDD() {
var eddDateStr = document.getElementById("eddDate").value;
var resultDiv = document.getElementById("pregnancyResult");
resultDiv.innerHTML = ""; // Clear previous results
if (!eddDateStr) {
resultDiv.innerHTML = "Please enter your Estimated Due Date.";
return;
}
var eddDate = new Date(eddDateStr + "T00:00:00"); // Ensure UTC
var today = new Date();
today.setHours(0, 0, 0, 0); // Normalize today's date to start of day
if (eddDate = 0 && currentWeeks = 14 && currentWeeks = 28) {
trimester = "Third Trimester";
} else {
trimester = "Not yet pregnant or invalid date range";
}
// Format dates for display
var options = { year: 'numeric', month: 'long', day: 'numeric' };
var lmpDisplay = lmp.toLocaleDateString('en-US', options);
var eddDisplay = eddDate.toLocaleDateString('en-US', options);
resultDiv.innerHTML =
"Based on your EDD of " + eddDisplay + ":" +
"Your estimated Last Menstrual Period (LMP) was: " + lmpDisplay + "" +
"Your current gestational age is approximately: " + currentWeeks + " weeks and " + currentDays + " days" +
"You are currently in your: " + trimester + "";
}