Age calculator

Find an exact age in years, months and days from a date of birth — calculated privately in your browser.

Defaults to today. Change it to calculate age on any other day.

Calculate an exact age, the way you would by hand

An age calculator turns two dates — a date of birth and a target date — into a precise span of time. The headline result is the calendar age in years, months and days, but a span of time can also be expressed entirely in months, weeks, days or hours, which is handy for tracking a baby’s growth, planning milestones, or settling the perennial “how many days old am I?” question.

How the maths works

Naively subtracting one date from another and dividing by 365 is wrong, because months and years have different lengths. Instead this tool anchors by months. First it counts the whole number of calendar months between the two dates:

  • totalMonths = (atYear − birthYear) × 12 + (atMonth − birthMonth)

It then advances the date of birth forward by totalMonths whole months to form an anchor date, clamping the day to the last day of the month where needed (so 31 January plus one month lands on 28 or 29 February, not an impossible 31 February). If that anchor overshoots the target, it drops one month and re-anchors. The leftover days are simply the whole days between the anchor and the target date, and the years and months come from splitting totalMonths back out: years = floor(totalMonths ÷ 12) and months = totalMonths − years × 12. Because every step uses the real length of each calendar month, leap years and 28-, 30- and 31-day months are handled automatically — and the day count can never come out negative, which a single-borrow subtraction can.

A worked example

Take a birth date of 15 March 1990 and a target date of 10 June 2024. The whole months between them are (2024 − 1990) × 12 + (6 − 3) = 411. Advancing 15 March 1990 by 411 months lands on 15 June 2024 — but that is after 10 June 2024, so we drop one month to 410 and re-anchor on 15 May 2024. The leftover days from 15 May to 10 June are 26 (16 days left in May plus 10 in June). Splitting 410 months back out gives floor(410 ÷ 12) = 34 years with 410 − 408 = 2 months. The exact age is therefore 34 years, 2 months and 26 days. Expressed differently, that is 410 total months, 1,786 weeks, or 12,506 days of life.

The totals at a glance

UnitHow it is derivedGood for
Years / months / daysBorrow-subtraction shown aboveThe conventional “how old” answer
Total monthsyears × 12 + monthsInfant & toddler milestones
Total weeksfloor(total days ÷ 7)Pregnancy and newborn tracking
Total daysWhole days between the two datesDay-count milestones (e.g. 10,000 days)
Total hourstotal days × 24Fun facts and curiosity
Privacy note: this calculator runs with no server and no tracking of your input. Your date of birth is read and computed entirely on your device, and it is never transmitted, logged or stored anywhere.

Frequently asked questions

How does the age calculator work out years, months and days?

It first counts the whole number of calendar months between your date of birth and the target date. It then advances your birth date by that many months to form an anchor date — clamping to the last day of the month where a day would not exist — and counts the leftover whole days from that anchor to the target. The months are finally split back into years and months. This keeps the result calendar-correct across months of different lengths and leap years, and it never produces a negative day count the way a simple borrow can.

Does it handle leap years correctly?

Yes. Because the anchoring step uses the real number of days in each calendar month, February with 28 or 29 days is handled automatically. Someone born on 29 February has their anchor clamped to 28 February in non-leap years, so the age still rolls over correctly.

Can I calculate age on a date other than today?

Yes. The "age at" date defaults to today, but you can change it to any date — past or future — to find someone’s age on a wedding day, a retirement date, or any historical moment. The target date simply must not be earlier than the date of birth.

What do the totals (months, weeks, days, hours) mean?

Alongside the exact years/months/days breakdown, the tool shows the same span expressed entirely in one unit: total whole months lived, total weeks, total days, and total hours. These are useful for milestones such as a 10,000-day birthday or a baby’s age in weeks.

How are days until the next birthday counted?

The tool finds your next birthday on or after the target date and counts the whole days between the two. If the target date is your birthday, it reports 0 days. February 29 birthdays are rolled to the next 29 February that exists.

Is my date of birth sent anywhere?

No. Every calculation runs entirely in your browser using JavaScript. Your dates are never uploaded, logged or stored, and nothing leaves your device.