AC
Age Calculator
Calculate your exact age in years, months, and days from any date of birth, plus total days lived and days until your next birthday.
More Math Tools
How to Use Age Calculator
Enter your date of birth in the first field. By default the calculator uses today's date for the "As Of" field, but you can change it to see your age on any past or future date — useful for legal documents, visas, or planning an event. The result updates instantly and shows your age as years, months, and days, plus total days lived and days remaining until your next birthday.
About Age Calculator
Age sounds like a simple idea — the number of years since you were born — but calculating it precisely is more involved than it looks. Most people mentally compute age by subtracting birth year from the current year, which works most of the time but breaks the moment you need the answer to the day, not just the year. A person born on 15 March 2000 is still 25 on 1 March 2026, not 26, because their birthday hasn't happened yet that year. Getting this right requires comparing not just years but months and days too, and "borrowing" from the next unit when a subtraction goes negative — the same way you'd borrow a ten when subtracting 47 from 82 by hand.
This calculator performs that exact calendar-accurate subtraction. It takes your date of birth and a reference date (which defaults to today, but can be set to any date — useful for figuring out how old you were, or will be, on a specific occasion), and works out the difference component by component: years, then months, then days, adjusting for variable month lengths and leap years along the way.
A common misconception is that you can get an accurate age by dividing the total number of days lived by 365.25 (the average length of a year, accounting for leap years). This gives a reasonable approximation but is not exact, because it assumes every "month" and "year" the person has lived through was an average length — but real months range from 28 to 31 days, and real years are 365 or 366 days depending on the leap-year cycle. Someone who has lived through more 31-day months than average, or an unusual number of leap years, will get a slightly wrong answer from the day-count-divide method. Calendar subtraction avoids this entirely because it works with the actual calendar dates involved, not an averaged constant.
Worked example: someone born on 3 June 1990, checked as of 18 July 2026, has a day difference of 18 − 3 = 15 (no borrowing needed), a month difference of 7 − 6 = 1, and a year difference of 2026 − 1990 = 36. The result is 36 years, 1 month, 15 days — and that is the only answer consistent with the real calendar, unlike an averaged day-count-divide estimate which could land a few days either side.
This calculator also reports the total number of days lived and the number of days remaining until the next birthday, which is handy for anticipating milestones like a 21st or 100th birthday, or for record-keeping systems that need an exact day count rather than a rounded year figure. Because everything is derived from real calendar dates rather than fixed-length approximations, the same logic holds correctly whether the span involved is a few weeks or many decades, and regardless of how many leap years fall inside it.
Details & Tips
Method: the calculator subtracts date components in order — days, then months, then years — borrowing from the next larger unit whenever a subtraction would go negative. In outline: days = asOf.day − dob.day; if negative, subtract one month and add the number of days in the previous month; months = asOf.month − dob.month (after the day borrow); if negative, subtract one year and add 12; years = asOf.year − dob.year (after the month borrow). The "days in previous month" figure is computed dynamically using JavaScript's new Date(year, month, 0) trick, which returns the last day of the month before the given one — this automatically accounts for 28, 29, 30, or 31-day months without a lookup table.
Worked example 1: date of birth 3 June 1990, reference date 18 July 2026. Days: 18 − 3 = 15 (no borrow needed). Months: 7 − 6 = 1 (no borrow). Years: 2026 − 1990 = 36. Result: 36 years, 1 month, 15 days. Total days lived: 13,192.
Worked example 2 (borrowing across a leap day): date of birth 29 February 2000, reference date 1 March 2026. Days: 1 − 29 = −28, so borrow a month — the month before March 2026 is February 2026, a non-leap year with 28 days, giving 1 − 29 + 28 = 0 days, and the month count drops by one before its own subtraction. Months: 3 − 1 − 1 = 1, then re-subtracting against the birth month (2) gives 0 months after the borrow resolves. Years: 2026 − 2000 = 26. Result: 26 years, 0 months, 0 days — meaning 1 March 2026 lands exactly on the 26-year mark from the 29 February 2000 birthday, handled gracefully even though 2026 has no 29 February of its own.
Edge cases handled:
- Date of birth after the "As Of" date: the calculator shows an explicit error ("Date of birth must be before the reference date") instead of a nonsensical negative age.
- Leap-year birthdays (29 February): the borrowing logic always asks the calendar what the previous month actually contained, rather than assuming 30 days, so it resolves correctly even in non-leap reference years.
- Same-day birthdays: if the reference date matches the day and month of birth exactly, the result is a whole number of years with 0 months and 0 days.
- Very old or far-future reference dates: the arithmetic works identically regardless of the year range, since it operates on real Date objects rather than fixed-precision counters.
Practical tip: if you need an age for a legal or administrative purpose (school enrolment cut-offs, insurance eligibility, employment minimum age), always double-check whether the relevant rule uses "age on the day of the event" or "age at the start of the year" — these can differ by up to a year for anyone whose birthday falls later in the year than the cut-off date, and this calculator's "As Of" field lets you test both scenarios directly by entering the exact cut-off date instead of today.
Frequently Asked Questions
How is my age calculated?
The calculator subtracts your date of birth from the reference date using calendar-accurate year/month/day subtraction with borrowing, the same method used for manual date arithmetic — not a simple day-count division.
Why is dividing total days by 365 not accurate?
Real years are 365 or 366 days and real months range from 28 to 31 days, so an average-based division only approximates your true calendar age rather than matching it exactly.
What if I was born on 29 February?
The calculator resolves this automatically by asking the calendar what the previous month actually contained, so leap-day birthdays work correctly even in non-leap reference years.
Can I find my age on a date other than today?
Yes — change the "As Of" field to any past or future date to see your exact age on that specific day.
What happens if I enter a date of birth after the "As Of" date?
The calculator shows an error message asking you to correct the order, since age cannot be negative.
How is "days until next birthday" worked out?
It finds the next occurrence of your birth month and day on or after the "As Of" date and counts the days remaining until then.
Does the calculator account for leap years?
Yes, both in the total-days-lived figure and in the years/months/days breakdown, since all arithmetic uses real calendar dates rather than a fixed 365-day year.
Can I use this for something other than a person's age?
Yes — it works for any date-of-birth-style calculation, such as a pet's age, a document's age, or time since an event.
Is my date of birth stored or sent anywhere?
No — all calculations run in your browser and nothing is saved or transmitted.
Why do I sometimes get "0 years, 0 months, 0 days"?
That happens when the "As Of" date exactly matches your date of birth in a later year — meaning it is your exact birthday.
Does time zone affect the result?
No — the calculator works with calendar dates only (year, month, day), not exact times, so time zone has no effect on the outcome.
Part of These Collections
Also Available As
age calculator, how old am i, birthday calculator, exact age calculator, date of birth calculator, years months days calculator
Explore More Tools
View all toolsFound a Problem?
Let us know if something with Age Calculator isn't working as expected.
Something went wrong. Please try again.
Thanks — we'll take a look.