Age Calculator

Find your exact age in years, months, days from a birth date.

How this works

Pick a birth date and an "as of" date (today by default), and the calculator returns your age the way a person would say it: years, months and days. It also gives you the total days lived, the total weeks, and how many days until the next birthday — useful for visa applications, retirement planning, age-restricted milestones, or just for fun. Borrowing across months follows the human convention: if your birthday hasn't happened yet this year, you're still last year's age.

The formula

years = asOf.year − birth.year months = asOf.month − birth.month days = asOf.day − birth.day If days < 0: months -= 1; days += daysInPreviousMonth If months < 0: years -= 1; months += 12

Total days are computed from the millisecond difference between the two timestamps, divided by 86,400,000 ms/day. We use floor() rather than round() so partial days don't prematurely tick over. Leap years and DST shifts are handled by the underlying Date arithmetic — if the as-of moment is even one second before the birth-time-of-day on a birthday, you're still the previous age.

Example calculation

  • Birth date 1990-01-15. As-of date 2024-04-28.
  • Years = 2024 − 1990 = 34. Months = 4 − 1 = 3. Days = 28 − 15 = 13. No borrow needed.
  • Result: 34 years, 3 months, 13 days. Total days lived ≈ 12,521. Days to next birthday ≈ 262.

Frequently asked questions

How does the calculator handle leap-year birthdays (Feb 29)?

In non-leap years, JavaScript's Date interprets "Feb 29" as March 1, which means a leap-year baby technically gets a birthday every common year. The calculator inherits that behaviour: an as-of date of March 1 in a non-leap year counts the birthday as already passed. Most legal systems use the same convention; a few (e.g. Taiwan) treat the birthday as Feb 28 in non-leap years instead.

Why does the years/months/days breakdown differ from total days?

Because months don't have a fixed number of days. Saying "34 years, 3 months, 13 days" is a calendar description; saying "12,521 days" is a literal count. They're equivalent representations of the same elapsed time, just expressed differently. Multiplying years × 365.25 + months × 30.44 will get close to the total-days figure but won't match exactly.

Does the calculator account for time zones?

It uses your browser's local time zone for both dates. Since the date inputs only have day-level precision, time-zone effects are usually irrelevant — but if you were born just before midnight in a different time zone than the one you're using now, the result could be off by a day. For exact legal-age purposes, look up the time-of-birth in the original local time zone and adjust manually.

Why does it say 'Birth date must be on or before the as-of date'?

Because age can't be negative — you can't be older than yourself. If you're trying to figure out how old someone will be on a future date, swap the dates: put their birth date in the first field and the future date in the second. The calculator will give you their age at that point. It's the same calculation either way.