Calculating age from a date of birth sounds trivial — but doing it precisely, accounting for leap years and partial months, is more nuanced than most people realize. Whether you need an exact age for a legal document, a fun age breakdown, or a programming formula, this guide covers all the methods.

The Simple Method: Years Only

For most everyday purposes, age in complete years is all you need:

Age = Current Year − Birth Year If birthday hasn't occurred yet this year: Age = Current Year − Birth Year − 1

Example: Born March 15, 1990. Today is March 5, 2026.

2026 − 1990 = 36. But the birthday (March 15) hasn't happened yet in 2026 (today is March 5). So age = 36 − 1 = 35 years old.

→ Use our Age Calculator for exact age in years, months, and days.

Calculating Exact Age in Years, Months, and Days

For a precise age, you need to account for partial months and years:

Step 1: Calculate complete years (birthday already passed = full year) Step 2: Calculate remaining months after the last birthday Step 3: Calculate remaining days after the last anniversary month

Detailed Example:

Born: June 15, 1985 | Today: March 5, 2026

  1. Last birthday was June 15, 2025 (June 2026 hasn't occurred yet)
  2. Complete years = 2025 − 1985 = 40 years
  3. From June 15, 2025 to March 5, 2026: June 15 → March 15 = 9 months
  4. March 5 is 10 days before March 15, so: 8 months and 18 days remaining
  5. Age = 40 years, 8 months, 18 days

Leap Year Birthdays (February 29)

People born on February 29 (leap day) face a unique challenge: their birthday only exists once every 4 years. Different jurisdictions handle this differently:

  • Most countries and legal systems: Use March 1 as the official birthday in non-leap years
  • Some countries (e.g., UK, Hong Kong): Use February 28 in non-leap years
  • Common celebration practice: Many leap-day birthdays choose to celebrate on February 28

For age calculation purposes, a person born February 29, 1992 turns 34 (for example) on either February 28 or March 1, 2026, depending on local legal convention.

How to Calculate Age in Excel

Excel has built-in functions for age calculation:

Age in years (complete): =DATEDIF(birth_date, TODAY(), "Y") Age in years, months, days: =DATEDIF(A1,TODAY(),"Y")&" years, "&DATEDIF(A1,TODAY(),"YM")&" months, "&DATEDIF(A1,TODAY(),"MD")&" days" Age using YEARFRAC (decimal years): =INT(YEARFRAC(birth_date, TODAY(), 1))

The DATEDIF function is not documented in Excel's help but works reliably. Replace "birth_date" with the cell reference containing the date of birth (e.g., A1).

How to Calculate Age in Python, JavaScript, and SQL

Python:

from datetime import date born = date(1990, 6, 15) today = date.today() age = today.year - born.year - ((today.month, today.day) < (born.month, born.day))

JavaScript:

function getAge(birthDate) { const today = new Date(); const birth = new Date(birthDate); let age = today.getFullYear() - birth.getFullYear(); const m = today.getMonth() - birth.getMonth(); if (m < 0 || (m === 0 && today.getDate() < birth.getDate())) age--; return age; }

SQL:

-- PostgreSQL / MySQL SELECT FLOOR(DATEDIFF(CURDATE(), birth_date) / 365.25) AS age;

Age Milestones and Fun Facts

Interesting age-related calculations:

MilestoneAge / Calculation
1 billion seconds oldAt approximately 31 years, 251 days
10,000 days oldAt approximately 27 years, 4.5 months
Average human lifespan~72.6 years globally (WHO 2023)
Days in a 30-year life~10,957 days

→ Calculate how many days between any two dates.

Frequently Asked Questions

Subtract your birth date from today's date. The result in days is your exact age. For example, if you were born on January 1, 1990, and today is March 5, 2026, count the total days between those dates. Our Days Between Dates calculator does this instantly.
In 2026, you would be 35 or 36 years old, depending on whether your birthday has occurred yet in 2026. If your birthday falls before March 5, 2026, you are 36. If it falls after March 5, 2026, you are still 35.
Most countries count age the same way — the number of complete years since birth. However, some East Asian age-counting traditions count a person as 1 year old at birth (and add a year each new year), making someone potentially 2 in their first calendar year of life. Western legal systems use completed years.
Use =DATEDIF(A1, TODAY(), 'Y') where A1 contains the date of birth. This gives the age in complete years. For full breakdown use: =DATEDIF(A1,TODAY(),"Y")&" yrs "&DATEDIF(A1,TODAY(),"YM")&" mo "&DATEDIF(A1,TODAY(),"MD")&" days"