ForHosting KIT · Dates & time

Pregnancy week from last period

With a last period that began on 1 January 2026, on 12 March 2026 the pregnancy is 10 weeks and 0 days, first trimester, due around 8 October 2026. Enter both dates to get the week, days and trimester. 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
First day of last period
2026-01-01
Reference
2026-03-12
You get
Gestational days
70
Weeks
10
Days
0
Display
10w+0d

Knowing how many weeks pregnant someone is almost always starts from the first day of the last menstrual period, not from the conception date itself. Midwives, prenatal apps, and triage forms express that age as completed weeks plus remaining days—for example twelve weeks and three days—so every chart, ultrasound label, and patient message can agree on the same number. This pregnancy week from last period calculator accepts an explicit LMP date and an explicit reference date as strict ISO calendar strings, counts whole Gregorian days between them in a UTC-neutral civil calendar, and returns the gestational week, day remainder, a compact display string, trimester band, and a standard two-hundred-eighty-day estimated due date. Nothing is inferred from the server clock: the client supplies both dates, so batch jobs, historical chart reviews, and free browser checks stay reproducible.

How gestational week and day are defined from the LMP

Obstetric gestational age is customarily counted from the first day of the last menstrual period even though fertilization usually occurs about two weeks later. That convention keeps dating consistent across clinics when the exact conception day is unknown. This capability implements the completed-weeks form of that rule: take the whole number of civil calendar days from the LMP date to the reference date, divide by seven, and report the integer quotient as weeks and the remainder as days.

On the LMP day itself the difference is zero, so the result is zero weeks and zero days. Seven days later the result is one week and zero days; ten days later it is one week and three days. A trimester field follows a common educational split: completed weeks zero through thirteen map to the first trimester, fourteen through twenty-seven to the second, and twenty-eight or more to the third.

Those bands are convenience metadata for dashboards; clinical staging can differ by protocol, so treat them as derived labels rather than diagnostic codes. Leap days are validated and included when they fall between the two dates, so February twenty-nine in a leap year never silently becomes March first.

Where knowing the pregnancy week helps

Prenatal intake forms and patient portals need a deterministic oracle so mobile, web, and back-office tools print the same 12w+3d for the same LMP and visit date. Charting pipelines that re-score historical encounters must not depend on when the worker process ran, which is why both dates are explicit inputs and why the implementation never calls Date.now. Research assistants cleaning self-report exports can convert LMP and survey dates into gestational weeks without standing up a full obstetrics stack.

Sibling KIT capabilities estimate due date alone or pregnancy weight-gain bands; this landing targets the distinct search intent of current gestational week and day from LMP. Failed validation does not consume balance.

Prenatal visit age labels

Convert LMP and appointment date into completed weeks + days (and 12w+3d display) for chart headers and patient messages.

Historical chart re-scoring

Recompute gestational age for archived encounters with explicit as-of dates so results never depend on the server clock.

Does the calculator use today’s date automatically?

No. Both lmp and reference are required explicit ISO dates so results are deterministic and timezone-independent.

What if the reference date is before the LMP?

Gestational age cannot be negative under the completed-weeks-from-LMP convention.

Why is pregnancy counted from the last period and not from conception?

Because the exact day of conception is rarely known, while the first day of the last period usually is. Fertilization tends to happen about two weeks later, but counting from the period keeps dating consistent between clinics.

How is the estimated due date worked out?

It is set 280 days after the first day of the last period. A period that began on 1 January 2026 gives an estimated due date of 8 October 2026.

Which weeks belong to each trimester?

Completed weeks 0 to 13 are shown as the first trimester, 14 to 27 as the second and 28 onward as the third. These are general labels; your clinic may stage pregnancy differently.

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/date/pregnancy-week-from-lmp

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/date/pregnancy-week-from-lmp \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lmp":"2026-01-01","reference":"2026-03-12"}'
{
  "lmp": "2026-01-01",
  "reference": "2026-03-12"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "date.pregnancy_week_from_lmp",
  "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 dates and a reference before the LMP fail with invalid_input instead of inventing a negative age.

How gestational week and day are defined from the LMP

The response field display packages the same pair as a short string such as 12w+3d for UI labels and export columns. Because both endpoints are pure calendar dates without times of day, the count is independent of time zones: YYYY-MM-DD strings are interpreted as civil dates, and the day difference is the same as comparing midnight-to-midnight on a proleptic Gregorian timeline.

Input contract, response shape, and error behaviour

Both must be real Gregorian days in strict YYYY-MM-DD form with zero-padded month and day. Validation failures are not billed. Example: lmp 2026-01-01 and reference 2026-03-12 yield seventy gestational days, ten weeks and zero days, display 10w+0d, first trimester, and due date 2026-10-08. POST a JSON body with two required string fields: lmp, the first day of the last menstrual period, and reference, the calendar day for which you want gestational age. Aliases accepted for the LMP include last_menstrual_period, lmp_date, and period_start; for the reference date, as_of, on_date, date, and today are accepted so client code can reuse familiar keys. Non-strings that are not numeric year-month-day forms, empty values, impossible days such as 2023-02-29, and months outside zero-one through one-two fail with invalid_input naming the field. On success the body echoes normalized lmp and reference, gestational_days as the non-negative whole-day difference, weeks and days as the floor-division pair, display as the Nw+Dd string, trimester as one, two, or three, due_date as LMP plus two hundred eighty days on the civil calendar, days_to_due as two hundred eighty minus gestational_days (negative when past the estimate), and a formula string restating the serial-day rule. Pair the numbers with your own counselling copy; this endpoint does not provide medical advice, ultrasound correction, or embryo-transfer dating rules.

Where a pregnancy-week API earns its keep

Keep requests small, pin weeks, days, and due_date in tests, and you get reproducible gestational age for apps, LMS modules, and edge workers without hosting custom calendar code of your own.

Pregnancy-week SEO widgets

Power a free browser calculator for “how many weeks pregnant from last period” with the same pure module the API bills at $0.002.

How do I calculate pregnancy week from my last period?

Send lmp and reference as YYYY-MM-DD. The API returns gestational_days, weeks, days, and display (for example 10w+0d) using whole civil days from LMP to the reference date.

How is the due date in the response computed?

due_date is LMP plus 280 whole Gregorian days (standard 40-week estimate). days_to_due is 280 minus gestational_days and may be negative after that estimate.

What does the pregnancy week from last period tool cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →