Utility

Age Calculator: From Birth Date to Exact Age

How age is calculated from a birth date, including leap year handling, Gregorian calendar rules, and the ISO 8601 date standard.

Verified against ISO 8601 - Date and Time Representations on 20 Feb 2025 Updated 20 February 2025 4 min read
Open calculator
Read in other languages (4)

Summary

An age calculator determines the exact time elapsed between a birth date and a target date, expressed in years, months, and days. While the concept seems simple, calendar irregularities — months of different lengths, leap years, and timezone differences — make precise age calculation surprisingly nuanced. Most legal and medical systems define age as the number of complete years since birth, incrementing on each birthday.

How it works

The calculator computes age by:

  1. Counting complete years — the number of birthdays that have passed by the target date.
  2. Counting remaining months — the number of complete months after the last birthday.
  3. Counting remaining days — the leftover days after the last complete month.

The result is also expressed as total months, total weeks, and total days for convenience.

Leap year rules

The Gregorian calendar defines a leap year as:

  • Divisible by 4 and
  • Not divisible by 100 unless also divisible by 400

This means 2000 was a leap year, but 1900 was not. February 29 birthdays are handled by treating March 1 as the birthday in non-leap years.

The formulas

Age (years) = target_year - birth_year - adjustment

Where

target_year= The year of the target date
birth_year= The year of birth
adjustment= 1 if the birthday has not yet occurred in the target year, else 0
Leap year: (y % 4 == 0) AND ((y % 100 != 0) OR (y % 400 == 0))

Where

y= The year to test
%= Modulo (remainder) operator

Worked examples

Age on 2025-02-20 for someone born 1990-07-15

1

Count complete years

2025 - 1990 = 35, but July 15 has not passed in Feb, so subtract 1

= 34 years

2

Count remaining months after last birthday (July 15, 2024)

Aug, Sep, Oct, Nov, Dec, Jan = 6 complete months, then Feb 15 has not arrived

= 7 months (Jul 15 to Feb 15)

3

Count remaining days

Feb 15 to Feb 20 = 5 days

= 5 days

Result

34 years, 7 months, and 5 days old

Leap year birthday: born Feb 29, 2000 -- age on Mar 1, 2025

1

Count complete years

2025 - 2000 = 25, birthday (Feb 29) does not exist in 2025

= 25 years (birthday treated as passed on Mar 1)

2

Remaining months and days

The day after the 'birthday equivalent' in a non-leap year

= 0 months, 0 days

Result

25 years, 0 months, 0 days (just turned 25)

Practical uses

  • Legal age verification — determining eligibility for driving, voting, drinking, retirement, and contracts.
  • Medical milestones — pediatric growth charts and vaccination schedules rely on exact age in months and days.
  • Insurance and pensions — premiums and benefit amounts often depend on exact age at a specific date.
  • Astrology and genealogy — precise birth-to-date calculations for charts and family records.

Assumptions & limitations

  • Gregorian calendar only — the calculator assumes the Gregorian calendar throughout. Dates before the Gregorian adoption (1582 in most of Europe, later elsewhere) may not be historically accurate.
  • No timezone handling — the calculation uses calendar dates without considering timezones or the exact time of birth.
  • Feb 29 birthdays — in non-leap years, conventions vary by jurisdiction. Some legal systems treat March 1 as the birthday; others use February 28. This calculator uses March 1.
  • Future dates — entering a birth date in the future produces a negative age, which the calculator displays as zero.

Sources

Industry
age date birthday leap-year calendar utility