Age Calculator

How to Calculate Someone's Exact Age

📅 April 2026⏱ 6 min read✍️ ToolsBox

Calculating someone's age sounds trivial — subtract their birth year from the current year. But precise age calculation gets surprisingly nuanced when you need to account for whether they have had their birthday yet this year, handle leap years correctly, and express the result in years, months, and days simultaneously. This guide covers everything from the simple case to the edge cases that trip up developers.

The Basic Age Calculation

The simplest approach subtracts the birth year from the current year:

Age = Current Year − Birth Year

However, this is only correct if the person's birthday has already occurred this year. If today is June 15 and someone was born on December 3, 1990, the naive calculation gives 2026 − 1990 = 36, but they have not yet turned 36 — they are still 35.

The correct formula for completed years:

  1. Subtract birth year from current year.
  2. If the person's birthday has not yet occurred this calendar year (their birth month is after the current month, or the birth month is the same as the current month but the birth day is after today), subtract 1 from the result.

Calculating Age in Years, Months, and Days

For a precise breakdown, the algorithm is more involved:

  1. Start with the birth date and today's date.
  2. Calculate completed years as above.
  3. Advance the birth date by the completed years to get the last birthday date.
  4. Calculate completed months between the last birthday and today (subtract 1 if the day of month has not been reached yet).
  5. Advance the last birthday by the completed months to get the last "month anniversary" date.
  6. Count the remaining days between that date and today.

For example, if someone was born on 15 March 1990 and today is 17 April 2026:

  • Completed years: 36 (their 36th birthday was 15 March 2026)
  • Completed months since last birthday: 1 (the 15th of April has not been reached — wait, 17 April > 15 April, so 1 full month)
  • Remaining days: 17 − 15 = 2 days
  • Result: 36 years, 1 month, 2 days

The Leap Year Complication

Leap years add complexity in two places:

February 29 birthdays: People born on February 29 only have an exact birthday every four years. In non-leap years, their birthday is typically recognised on February 28 (in most legal contexts). Some systems recognise it on March 1. Our Age Calculator uses February 28 as the non-leap birthday, which is the most common convention.

Month length variation: Months have different numbers of days — 28, 29, 30, or 31. This means "one month" from January 31 is not a straightforward calculation. The standard convention is to go to the same day number in the next month; if that day does not exist (January 31 + 1 month → February 31, which does not exist), use the last day of the month instead.

Age Calculation in Code

Here is a JavaScript implementation that calculates exact age in years, months, and days:

function calculateAge(birthDate) {
  const today = new Date();
  let years = today.getFullYear() - birthDate.getFullYear();
  let months = today.getMonth() - birthDate.getMonth();
  let days = today.getDate() - birthDate.getDate();

  if (days < 0) {
    months--;
    const lastMonth = new Date(today.getFullYear(), today.getMonth(), 0);
    days += lastMonth.getDate();
  }
  if (months < 0) {
    years--;
    months += 12;
  }
  return { years, months, days };
}

This handles the main edge cases cleanly. You can also use our Date Calculator to find the difference between any two dates in years, months, and days.

Interesting Age Milestones

A 30-year-old has lived approximately 10,950 days (accounting for about 7 or 8 leap years). A 40-year-old has been alive for roughly 14,610 days. If you want to know exactly how many days old you are, use our Age Calculator — it shows your age in years, months, days, and total days simultaneously.

The calculator is also useful for legal and administrative contexts — checking if someone is old enough to vote (18), drive (16–17 depending on country), or retire (varies by country and pension plan).

Calculate your exact age — free

Years, months, days and total days — all calculated instantly from your date of birth.
Open Age Calculator →

Frequently Asked Questions

How old am I if I was born in a leap year on February 29?

In non-leap years, leap-day birthdays are typically celebrated on either February 28 or March 1. For legal and official purposes, most jurisdictions treat February 28 as the birthday in non-leap years. The actual number of years elapsed is the same as anyone born on that date.

What is the difference between age in completed years vs exact age?

Age in completed years (the common understanding) counts full years since birth and ignores remaining months and days. Exact age includes the fractional year — for example, 25 years, 3 months, and 14 days. For legal purposes (voting, retirement), only completed years matter.

How do I calculate age from a date of birth in JavaScript?

Create a Date object for the birth date, get the difference in milliseconds from today, convert to years. Simple formula: Math.floor((new Date() - new Date(birthDate)) / (1000 * 60 * 60 * 24 * 365.25)). For precise month-accurate results, compare the month and day against today's date.

How many days old am I?

Subtract your birth date from today's date to get the number of days. Our Age Calculator shows this automatically — for a 30-year-old, it's approximately 10,958 days (accounting for leap years). Use the calculator for your exact count.

Back to Blog  |  Related tool: Age Calculator