Age Calculator
Calculate your exact age in years, months, and days — plus total weeks, days, hours, minutes, and seconds — and count down to your next birthday.
Your age
Total lived
What this age calculator does
This calculator tells you your exact age the way humans actually count it: years, months, and days. It also expresses how long you have been alive in total months, weeks, days, hours, minutes, and seconds, and shows how many days remain until your next birthday. Enter a birth date, leave the "as of" field on today (the default), and press Calculate.
Why is this more useful than a simple "years old" number? Because age is a weird unit. A year is not a fixed number of days — 2024 had 366, 2025 will have 365 — and a month ranges from 28 to 31 days. Most online calculators take shortcuts (dividing milliseconds by 30.44 or 365.25) which give wrong answers around leap years and month boundaries. This one uses calendar-aware arithmetic so the result matches common sense.
How the calculation works
The algorithm is the same one you would use on paper. Starting from the "as of" date, we subtract the birth date:
- Subtract the year portion:
years = asOf.year − birth.year. - Subtract the month portion:
months = asOf.month − birth.month. - Subtract the day portion:
days = asOf.day − birth.day. - If days are negative, borrow one month — add the previous month's actual length (28, 29, 30, or 31 days).
- If months are now negative, borrow one year — add 12 months.
For the "total" outputs (hours, minutes, seconds) we simply divide the elapsed milliseconds by the appropriate constant. These are accurate to within a few seconds because we operate on dates at midnight, not timestamps.
Worked example
Suppose someone was born on 14 March 1990 and the "as of" date is 2 November 2024.
- Year diff: 2024 − 1990 = 34
- Month diff: 11 − 3 = 8
- Day diff: 2 − 14 = −12 → borrow one month. October has 31 days, so days becomes −12 + 31 = 19. Months becomes 8 − 1 = 7.
- Final age: 34 years, 7 months, 19 days.
- Total days lived: approximately 12,651. Total hours: approximately 303,624.
- Next birthday (14 March 2025) is 132 days away.
Why not just divide by 365.25?
A common shortcut is ageYears = msDiff / (365.25 × 24 × 3600 × 1000)
— the 365.25 accounting for leap years in a Gregorian cycle. This gives a
reasonable decimal but two bad answers:
- On your birthday it may read 29.9997 instead of 30. People round down.
- It hides the months-and-days breakdown that you actually want.
Worse, "years × 365" or "months × 30" approaches fall apart on leap-day birthdays and around 31-day months. Borrow arithmetic on real calendar dates is the only method that always produces the "X years, Y months, Z days" answer humans expect.
Uses for an age calculator
- Celebrations: count the exact days to a birthday, anniversary, or milestone.
- Paperwork: figure out precise age for forms that need years and months (child development, passports, retirement eligibility).
- Parenting: track your child's age in months for growth and vaccine schedules.
- Fitness & health: age in total days is handy for some fitness age calculations and training plans.
- Curiosity: see just how many seconds you have been alive — a surprisingly large number that makes deadlines feel a little less scary.
Common mistakes
- Swapping the two dates. If your "as of" date is before your birth date the calculator throws an error. Make sure birth comes first.
- Wrong time zone expectations. Dates are treated as midnight local time. If you compare across time zones the total hours can differ by a few hours; for everyday age that is invisible.
- Assuming every month is 30 days. It is not. The calculator borrows from the correct calendar month, so "one month old on the 31st" is treated correctly even when the previous month was February.
- Expecting exact decimals. "34.58 years" is not very meaningful — use the years+months+days breakdown instead.
When to consult a professional
For legal, medical, or tax purposes where exact ages matter (age of consent, age-dependent insurance rates, statute-of-limitations dates, certain benefit entitlements), always cross-check with an official document and the relevant authority. This calculator is mathematically correct, but the legally binding age in any given jurisdiction may depend on local conventions (for example, whether someone born on 29 February reaches age 18 on 28 February or 1 March in a non-leap year).
Frequently Asked Questions
How does this age calculator work?
Does the calculator handle leap years correctly?
Date constructed from year, month, day), which natively knows that 2024 has 366 days and that February 29 only exists in leap years. When a non-leap year has passed between a leap-day birthday and "today", the calculator still counts one full year as expected.How are people born on February 29 handled?
What does "total months" mean?
years × 12 + months — the number of complete calendar months you have lived. It is not the diff in milliseconds divided by 30.44, because months have different lengths. This is the figure you would give if someone asked how many months old your child is.