To calculate age, subtract the birth year from the current year, then subtract 1 more if this year's birthday hasn't happened yet. For an exact age, count the completed years first, then the completed months since the last birthday, then the days left over: someone born on May 15, 1990 is 36 years, 5 months and 2 days old on October 17, 2026.

The years part is simple and every method agrees on it. The months and days are where calculators can differ, because months run from 28 to 31 days. This guide walks through the exact method step by step, shows worked examples computed in Python, covers February 29 birthdays, and gives formulas for Excel and Python. To skip the arithmetic, use the Age Calculator.

The quick method: age in completed years

Age in years always means completed years, the number of birthdays that have passed:

  1. Subtract the birth year from the current year.
  2. If the birthday hasn't arrived yet this year, subtract 1.

Born May 15, 1990, checking on October 17, 2026: 2026 − 1990 = 36, and May 15 has already passed, so the age is 36. Checking on March 1, 2026 instead, the birthday is still ahead, so the age is 35. Someone who is 35 years and 11 months old is still 35. Don't divide total days by 365 or 365.25 to get years: leap days make that estimate wrong by a day right around a birthday.

The exact method: years, then months, then days

For a full "X years, Y months, Z days" answer, count in order from the birth date:

  1. Years: count completed years to the most recent birthday.
  2. Months: from that birthday, count how many whole months fit before passing the target date. Each month ends on the same day number as the birthday.
  3. Days: count the days from that last month-anniversary to the target date.
  4. Short months: if the birth day doesn't exist in a month (the 31st in September, or the 29th to 31st in February), use that month's last day.

Example 1: born May 15, 1990, on October 17, 2026. The last birthday was May 15, 2026, so 36 years. Monthly anniversaries run June 15, July 15, August 15, September 15 and October 15, so 5 months. October 15 to October 17 is 2 days. Result: 36 years, 5 months, 2 days.

Example 2: born August 31, 1990, on October 17, 2026. The last birthday was August 31, 2026, so 36 years. There's no September 31, so the first monthly anniversary is September 30, which gives 1 month. October 31 hasn't arrived. September 30 to October 17 is 17 days. Result: 36 years, 1 month, 17 days.

This is the method the Age Calculator on this site uses.

Worked examples

Each row below was computed in Python with the method above. The total-days column is a plain count of calendar days, so every correct calculator should match it exactly.

Date of birthAge onYears / months / daysTotal days
May 15, 1990Oct 17, 202636 years, 5 months, 2 days13,304
Dec 20, 1985Oct 17, 202640 years, 9 months, 27 days14,911
Aug 31, 1990Oct 17, 202636 years, 1 month, 17 days13,196
Mar 14, 2000Mar 14, 202626 years, 0 months, 0 days9,496
Mar 14, 2000Sep 30, 202626 years, 6 months, 16 days9,696
Feb 29, 2008Feb 28, 202617 years, 11 months, 30 days6,574
Feb 29, 2008Mar 1, 202618 years, 0 months, 1 day6,575

How to calculate age in Excel with DATEDIF

Put the date of birth in A2 and the "as of" date in B2 (or use TODAY()). Microsoft documents DATEDIF with the syntax DATEDIF(start_date, end_date, unit):

=DATEDIF(A2,B2,"Y")                         completed years
=DATEDIF(A2,B2,"YM")                        months after the last birthday
=B2-EDATE(A2,DATEDIF(A2,B2,"M"))            days after the last month-anniversary

=DATEDIF(A2,B2,"Y")&" years, "&DATEDIF(A2,B2,"YM")&" months, "&(B2-EDATE(A2,DATEDIF(A2,B2,"M")))&" days"

DATEDIF also has an "MD" unit for the leftover days, but Microsoft says it doesn't recommend using it "as there are known limitations with it," and that it may return a negative number, zero or an inaccurate result. The EDATE version above avoids it: EDATE adds the completed months to the birth date, and subtracting that from the end date leaves the days. Format that cell as a number, not a date. If the start date is later than the end date, DATEDIF returns #NUM!.

We tested every formula here in LibreOffice Calc against all seven rows of the table above, and the combined formula matched each one. In the same test, "MD" returned −1 for January 31 to March 2, 2026, and 16 instead of 17 for August 31, 1990 to October 17, 2026, which shows why Microsoft warns against it.

How to calculate age in Python

Completed years need only the standard library. Comparing (month, day) tuples handles the "has the birthday happened yet?" check:

from datetime import date

def age_years(born, today):
    return today.year - born.year - ((today.month, today.day) < (born.month, born.day))

age_years(date(1990, 5, 15), date(2026, 10, 17))   # 36

For years, months and days, this function follows the exact method above, including the short-month rule:

import calendar
from datetime import date

def age_ymd(born, today):
    months = (today.year - born.year) * 12 + (today.month - born.month)
    if months > 0 and today.day < born.day:
        months -= 1
    y, m = divmod(born.month - 1 + months, 12)
    y += born.year
    last_day = calendar.monthrange(y, m + 1)[1]
    anchor = date(y, m + 1, min(born.day, last_day))
    return months // 12, months % 12, (today - anchor).days

age_ymd(date(1990, 8, 31), date(2026, 10, 17))   # (36, 1, 17)

The popular dateutil library's relativedelta(today, born) agrees on most dates, but not all. For a February 29, 2008 birth it reports 18 years, 0 months, 0 days on February 28, 2026, where the method above gives 17 years, 11 months, 30 days. For August 31, 1990 to September 30, 2026 it gives 1 month, 0 days, where the method above gives 0 months, 30 days. Neither is a bug; they're different conventions, which is the subject of the next section.

Why age calculators give different answers

Type the same birth date into two calculators and you can get two different "months and days" answers. The years should never differ. If they do, one tool has a real bug. The months and days differ because a month isn't a fixed length, so each tool has to decide what "one month after January 31" means.

Take January 31 to March 2, 2026, a gap of exactly 30 days. The method above, Python's relativedelta and the Excel EDATE formula all say 1 month and 2 days: the one-month mark falls on February 28, the last day of February. A tool that only counts a month once the same day number comes round says 0 months and 30 days. DATEDIF's "MD" unit produced 1 month and −1 days in our test. All describe the same 30-day gap.

Total days lived never disagrees

Total days is a straight count of calendar days between two dates, with no month-length ambiguity at all. Two correct calculators will always agree on it, which makes it the best sanity check. If two "years, months, days" results seem to conflict, compare the total days. If those match, only the month-splitting convention differs.

A quick way to sanity-check any age calculator

Try the calculator

Runs entirely in your browser. Your birth date is never sent anywhere.

Age Calculator →

Birthdays on February 29

In the Gregorian calendar, a year is a leap year if it's divisible by 4, except century years, which must also be divisible by 400. So 2000 was a leap year, 1900 wasn't, and 2100 won't be. Someone born on February 29 has an exact birthday only in leap years, so in other years a rule has to decide when their age goes up:

The law isn't uniform. In Scotland, section 6 of the Age of Legal Capacity (Scotland) Act 1991 says that for a person born on February 29, the relevant anniversary in a non-leap year "shall be taken to be 1st March." In England and Wales, section 9 of the Family Law Reform Act 1969 says a person reaches an age at the start of the anniversary of their birth, but doesn't address February 29 specifically. Rules vary in other countries and US states, and an agency may set its own rule for a license or benefit. If an exact legal age matters, check the rule the relevant authority uses rather than relying on any calculator.

Hours, minutes and time zones

Most age calculators ask only for a birth date, not a time. So "age in hours" is really total days × 24, counted from midnight, not the literal number of hours since birth. Daylight saving time makes some local days 23 or 25 hours long, and being born in a different time zone from where you live now can shift the calendar date by one. Treat hours and minutes as an illustration and total days as the exact figure.

When you need an exact age

Frequently asked questions

How do I calculate my age from my date of birth?

Subtract your birth year from the current year, then subtract 1 if your birthday has not happened yet this year. For example, someone born on May 15, 1990 is 36 on October 17, 2026, because 2026 - 1990 = 36 and May 15 has already passed.

How do I calculate exact age in years, months and days?

Count completed years to the last birthday, then whole months from that birthday, then the days left over. Born August 31, 1990, on October 17, 2026 gives 36 years, 1 month (September 30, since September has no 31st) and 17 days.

How do I calculate age in Excel?

With the birth date in A2 and the end date in B2, =DATEDIF(A2,B2,"Y") gives completed years and =DATEDIF(A2,B2,"YM") gives the extra months. For the leftover days, use =B2-EDATE(A2,DATEDIF(A2,B2,"M")), because Microsoft advises against DATEDIF's MD unit.

How does an age calculator handle a February 29 birthday?

In non-leap years there is no February 29, so a calculator treats the birthday as either February 28 or March 1. Both conventions are common. For legal or official purposes, check the rule that the relevant agency or jurisdiction actually applies.

Why do two age calculators show different months and days?

Because months vary from 28 to 31 days, tools resolve dates like January 31 to March 2 differently. One may show 1 month and 2 days, another 0 months and 30 days. The years and the total number of days should always match.

How do I calculate my age in months?

Multiply your completed years by 12 and add the extra completed months. Someone who is 36 years and 5 months old is 36 × 12 + 5 = 437 months old. Leftover days are not counted, because a month only counts once it is complete.

Is age in hours or minutes exact?

Usually not. Without a birth time, calculators count from midnight and multiply total days by 24. Daylight saving changes and time zones can also shift the result slightly. The total number of days is the exact figure; hours and minutes are an approximation.

Related tools