How to calculate an exact age: leap years and month ends

Why 2026 minus 1990 is not always 36, how month ends and 29 February birthdays are handled, and how to count an age in days without dividing by 30.

On this page

"How old is she?" sounds like a subtraction, and most of the time it is one. But an exact age in years, months and days has a few traps: a birthday that has not happened yet this year, months of different lengths, and people born on 29 February who only see their real birthday every four years. This article works through each of them with real dates, using the same rules as the age calculator. Every figure below was produced by the calculator's own logic and the day counts were checked separately with Python's datetime module.

The basic method

An exact age is counted in two steps:

  1. Count forward from the birth date in whole months, as far as you can without passing the target date.
  2. Count the days that are left.

Twelve whole months make a year. Take someone born on 15 May 1990, and ask how old they are on 13 October 2026:

  • 36 whole years take us to 15 May 2026.
  • Four more whole months take us to 15 September 2026. A fifth would be 15 October, which is after the target.
  • From 15 September to 13 October there are 28 days.

So the age is 36 years, 4 months and 28 days. In total that is 436 months, or 13,300 days. The calendar happens to make 13,300 days exactly 1,900 weeks, which is why 15 May 1990 was a Tuesday just like 13 October 2026. The next birthday is Saturday 15 May 2027, 214 days away, when the person turns 37.

Trap 1: subtracting the years

2026 − 1990 = 36 is only right once the birthday has passed this year. For someone born on 14 October 1990, on 13 October 2026 the subtraction still says 36, but the exact age is 35 years, 11 months and 29 days. The birthday is tomorrow.

This matters more than it seems. Age limits for school entry, driving, retirement or a job application are usually "has reached the age of N on date D", and a single day decides it. If you only compare years, you will be wrong for everyone whose birthday falls between the target date and the end of the year.

Trap 2: months are not all the same length

Months have 28, 29, 30 or 31 days, so "add one month" needs a rule when the day does not exist in the next month. The rule used by the calculator, by spreadsheets (EDATE), by most programming languages and by banks is:

When the day does not exist in the target month, use the last day of that month.

For a baby born on 31 January 2026:

DateExact age
28 February 20261 month, 0 days
1 March 20261 month, 1 day
30 March 20261 month, 30 days
31 March 20262 months, 0 days

Notice the second rule hidden in that table: each month is counted from the original birth date, never from the previous step. If you chained the steps (31 January → 28 February → 28 March), the baby would be "two months old" three days early, on 28 March. Counting each anniversary from the original 31 January lands on 31 March, which is what people expect.

Trap 3: born on 29 February

Someone born on 29 February 2000 has a real birthday only in leap years: 2004, 2008 and so on. In other years there are two common answers to "when are they a year older?":

  • 28 February, the last day of the month. This is the calculator's default, and it matches the month-end rule above.
  • 1 March, the day after 28 February. Some laws use this; in England and Wales, for example, a person born on 29 February legally comes of age on 1 March in a common year.

The difference is one day, and it shows up in two places. On 28 February 2001 the person is exactly 1 year old with the 28 February rule, but 11 months and 30 days with the 1 March rule. And on 13 October 2026 the countdown to the next birthday is 138 days (to 28 February 2027) or 139 days (to 1 March 2027). The age itself, 26 years, 7 months and 14 days, is the same with both rules on that date, because 13 October is far from February.

If a deadline or a legal age depends on it, check which rule your country or the contract uses. The calculator lets you switch.

Trap 4: dividing days by 30 or 365

It is tempting to compute an age in days and then divide. For the person born on 15 May 1990, 13,300 days ÷ 30 = 443.3 "months", but the real count is 436 whole months. Dividing by 365 gives 36.44 "years", and by 365.25 gives 36.41: close, but neither tells you whether the birthday has passed, and the decimals do not translate into months and days. Count calendar months first, then days; use totals only when you really want a total.

Totals in hours have their own small catch. The calculator gives hours as days × 24 (13,300 days = 319,200 hours). A day with a daylight-saving change is really 23 or 25 hours long on the clock, but without a birth time and a time zone, a more "precise" figure would only look precise.

Trap 5: the Vietnamese zodiac animal

The twelve animals (con giáp) follow the lunar year, which starts at Tết, somewhere between 21 January and 20 February. The calculator works from the calendar year, which is right for anyone born after Tết and an approximation for anyone born in January or early February.

For 20 January 1990, the calendar year says Canh Ngọ, the Horse. But Tết in 1990 fell on 27 January, so a baby born on 20 January was still in the year of Kỷ Tỵ, the Snake. The calculator flags every January and early-February birth and names the previous year's animal, so you know to check the date of Tết in your birth year. (Vietnam uses the Cat, Mão, where the Chinese zodiac has the Rabbit.)

Common mistakes

  • Comparing only the years. It is wrong for everyone whose birthday is still to come this year.
  • Chaining month additions. Adding one month at a time drifts after a short month. Count each anniversary from the birth date.
  • Assuming one leap-day rule. 28 February and 1 March are both in use; check which applies.
  • Dividing a day count by 30 or 365. Use calendar months and days, then totals only if you need them.
  • Mixing up international age and tuổi mụ. The traditional Vietnamese way adds a year at birth and another at each Tết, so it can be one or two more than the age on your ID card. Documents use the international age.
  • Using a computer clock at midnight. If you build this yourself, do not subtract JavaScript Date objects at local midnight: across a daylight-saving change a day can be 23 hours long and the division rounds the wrong way. Work with plain year-month-day values.

Try it

Open the age calculator, enter a birth date, and change the "age on" date to test the cases above: 31 January to 28 February, 29 February in a common year, or a birthday tomorrow. For days between any two dates, working days or adding months to a date, the date calculator uses the same calendar rules.

Tools mentioned in this article

Back to the blog