ForHosting KIT · Health & fitness

Gestational age from due date calculator

Works out how far along a pregnancy is from the due date: with a due date of 15 October 2026, on 15 May 2026 the pregnancy is at 18 weeks and 1 day, with 153 days to go. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Edd
2026-10-15
As of
2026-05-15
You get
Term days
280
Estimated lmp
2026-01-08
Gestational days
127
Weeks
18

This gestational age from due date calculator turns an estimated due date (EDD) and a reference calendar day into completed weeks and leftover days of pregnancy. You supply both dates as strict YYYY-MM-DD strings—never the server clock—so results stay reproducible for worksheets, prenatal education, and automated tests. By default the tool assumes a two-hundred-eighty-day (forty-week) term from estimated last menstrual period to EDD under Naegele’s rule, then reports gestational days, the familiar weeks-plus-days label, days remaining until the due date, trimester band, estimated LMP, and whether the reference day is past the EDD.

Counting a pregnancy back from the due date

Pregnancy is usually described in completed weeks plus leftover days, such as 18 weeks and 1 day. When the only anchor you have is an estimated due date, the standard method walks backward from it by the assumed term, 280 days for a classic 40-week pregnancy under Naegele's rule, to recover an estimated last menstrual period. From there it counts whole calendar days to the date you choose, leap years included. With a due date of 15 October 2026, the estimated period falls on 8 January 2026, and on 15 May 2026 the count is 127 days.

What the result shows and where it stops

Besides weeks and days, you see the total gestational days, the days left until the due date, the trimester and whether the reference date is already past term. You always pick the reference date yourself, so the same inputs give the same answer next week or next year, which suits worksheets and prenatal classes. Impossible calendar days are rejected, as are dates before the estimated last period or beyond 42 weeks. The calculation is educational: it does not replace ultrasound dating or the advice of the people caring for a pregnancy.

How gestational age is derived from an estimated due date

Clinicians and parents usually talk about pregnancy in completed weeks plus leftover days, for example twenty-eight weeks and three days. When the only anchor you have is an estimated due date rather than a confirmed last menstrual period, the standard reconstruction is to walk backward from the EDD by the assumed term length—two hundred eighty days for a classic forty-week pregnancy—to recover an estimated LMP, then count whole Gregorian calendar days from that LMP to your reference date.

Equivalently, gestational days equal term days minus the signed day distance from the reference date to the EDD. The path is educational and deterministic; it does not replace ultrasound dating, clinical judgment, or medical advice for individual patients.

Is the gestational age from due date calculator free?

The browser tool is free and runs offline.

How is gestational age worked out from a due date?

The calculator steps back 280 days from the due date to an estimated last menstrual period, then counts calendar days to your reference date. A due date of 15 October 2026 gives 127 days, or 18 weeks and 1 day, on 15 May 2026.

Can I change the 40-week assumption?

Yes. The term length defaults to 280 days, the classic 40 weeks of Naegele's rule, and can be set anywhere from 259 to 294 days, that is from 37 to 42 weeks.

What happens once the due date has passed?

The days remaining turn negative and the result flags that the reference date is past term. Gestational age is accepted up to 294 days, which is 42 completed weeks; later dates are rejected.

Does this replace dating by ultrasound?

No. It is an educational calculation based only on the due date you enter, and it does not replace ultrasound dating, clinical judgment or medical advice for an individual pregnancy.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/health/gestational-age-edd

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/health/gestational-age-edd \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"edd":"2026-10-15","as_of":"2026-05-15"}'
{
  "edd": "2026-10-15",
  "as_of": "2026-05-15"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "health.gestational_age_edd",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Invalid calendars, ages before estimated LMP, and ages beyond forty-two weeks return a clear invalid_input error and are not charged.

How gestational age is derived from an estimated due date

This calculator performs that integer identity with proleptic Gregorian serial day counts: each ISO date is validated as a real calendar day (including leap years), converted with the well-known days_from_civil mapping, and combined without floating-point day fractions, network lookups, or the host clock. On success you receive the normalized edd and as_of strings, the term_days assumption, estimated_lmp, gestational_days as a non-negative integer, weeks and days remainder, a human gestational_age string such as "18 weeks + 1 days", days_until_edd (negative when past due), trimester as one, two, or three using common clinical cut-points at thirteen and twenty-eight completed weeks, is_post_term when gestational days exceed the chosen term, and a short formula reminder.

Inputs, aliases, term length, and error contract

Both must be real Gregorian days in YYYY-MM-DD form with years from one through nine thousand nine hundred ninety-nine; impossible days such as twenty twenty-three February twenty-nine are rejected. After the math, gestational age must land between zero and two hundred ninety-four days inclusive—zero through forty-two completed weeks. The required edd field accepts aliases due_date, estimated_due_date, and due; the required as_of field accepts reference_date, on, date, and today so spreadsheets and forms can map columns without renaming. Optional term_days defaults to two hundred eighty and must be an integer between two hundred fifty-nine and two hundred ninety-four inclusive (thirty-seven through forty-two weeks) when you model an early or late full-term assumption. If as_of falls before estimated LMP, gestational days go negative and the API returns invalid_input with a message that names the fields to check. If as_of is more than two hundred ninety-four days after estimated LMP, the request is likewise rejected so post-forty-two-week outliers never invent a continuing schedule. Missing fields, non-ISO shapes, and non-integer term_days produce the same invalid_input code; failed validation is never charged. Pricing for successful calls is a flat $0.002 per request with unit item.

Practical uses, limits, and how this differs from related tools

Prefer a dedicated days-between tool when you only need calendar distance without the obstetric term model; prefer this capability when the output must be gestational weeks, days, trimester, and days until EDD under an explicit term length. Pair examples deliberately: EDD two thousand twenty-six October fifteenth with as_of two thousand twenty-six May fifteenth for a mid-second-trimester result; the same EDD with as_of equal to the EDD for a clean forty weeks and zero days at term; and a missing or inverted pair to demonstrate invalid_input. This landing targets searches such as gestational age from due date calculator, how far along from EDD, and weeks pregnant from estimated delivery date. It is not a due-date-from-LMP calculator (that is a different search intent served by other KIT tools), not a pregnancy weight-gain table, not an ultrasound biometry engine, and not medical advice. The free browser tool runs entirely offline in your session; the API charges only successful solves at $0.002, keeps no durable copy of your dates after the response, and returns the same rounded integer fields every time so local goldens match production.

Prenatal education worksheets

Educators give students an EDD and a reference day from a case vignette and compare hand-counted weeks-plus-days against the deterministic gestational_age string before class discussion.

Maternity app unit tests

Generate known-good mid-pregnancy, exact-term, and post-term fixtures plus deliberate invalid pairs for coding kata expected values without depending on Date.now().

Pipeline pre-check before milestone charting

Services validate EDD and as_of first, then store weeks, days, trimester, and days_until_edd only when the gestational window is inside zero through forty-two weeks.

What inputs does the gestational age from due date calculator need?

An estimated due date (edd) and a reference date (as_of), both as YYYY-MM-DD. Optional term_days defaults to 280 (40 weeks).

Why is as_of required instead of using today automatically?

The engine never reads the host clock. Supplying as_of keeps results identical across time zones, CI runs, and golden examples.

What happens if the reference date is before the estimated pregnancy start?

Gestational age would be negative, so the API returns invalid_input and asks you to check edd and as_of.

How far past the due date is still accepted?

Through 42 completed weeks (294 gestational days). Ages beyond that window return invalid_input.

Read the full KIT documentation →