Age Difference Between Two People Calculator

Age Difference Between Two People Calculator

Leading AI Skill PRO

Enter Calculation

Formula

ΔAge=|Date2−Date1|where{Date1=(Year1,Month1,Day1)Date2=(Year2,Month2,Day2)\Delta\text{Age} = \bigl|\, \text{Date}_2 - \text{Date}_1 \,\bigr| \\[1.5em] \text{where}\quad \left\{ \begin{aligned} \text{Date}_1 &= ({{\text{Year}_1}},\ {{\text{Month}_1}},\ {{\text{Day}_1}}) \\ \text{Date}_2 &= ({{\text{Year}_2}},\ {{\text{Month}_2}},\ {{\text{Day}_2}}) \end{aligned} \right.
Usage stats

Advertisement

Results

Age Difference
5 yr 5 mo 14 d
between the two birthdays
Years 5
Months 5
Days 14
Total days apart 1,991

Report an error on this page

What is the Age Difference Calculator?

This tool finds the exact difference between two people's birthdays. Enter each person's date of birth and it returns the gap expressed in years, months and days, plus the total number of days apart. It works regardless of which person is older — the calculator automatically uses the earlier date as the start.

How to use it

Pick the birth year, month and day for Person 1 and Person 2, then submit. The result shows the calendar difference broken into whole years, remaining months and remaining days, along with the total elapsed days for a precise comparison.

The formula explained

The breakdown subtracts the start date components from the end date components.

$$\text{diff} = |\text{date}_1 - \text{date}_2| \rightarrow \{\text{years},\ \text{months},\ \text{days}\}$$

If the day result is negative, we borrow one month and add the number of days in the start month.

$$\text{days} = \text{days} + \text{daysInMonth}(\text{start})$$

If the month result is then negative, we borrow one year and add 12 months. The total days is simply the millisecond difference divided by 86,400,000 (the number of milliseconds in a day), rounded to the nearest whole day.

$$\text{totalDays} = \left\lfloor \frac{|t_1 - t_2|}{86400000} \right\rceil$$
Advertisement
Timeline showing two birthdays with the gap split into years, months and days
The age difference is the gap between two birthdays, broken into years, months and days.

Worked example

Person 1: 31 January 1990. Person 2: 1 March 1990. Day: \(1 - 31 = -30\), so borrow: months becomes \(-1\) and days becomes \(-30 + 31 = 1\) (days in January). Month: \(-1 + 12 = 11\) and years drops by 1 to 0... after borrow we get 0 years, 1 month, 1 day. Adjusting for the standard calendar interpretation, the day count comes out positive as expected.

Two calendar pages connected by an arrow showing the span between two dates
Subtract the earlier date from the later one to find the total span.

How to Calculate an Age Gap by Hand

  1. Order the dates. Put the earlier birthday first (the start) and the later birthday second (the end). The gap is always the absolute difference, so the order of the people does not matter.
  2. Subtract each part separately. Compute year₂ − year₁, month₂ − month₁ and day₂ − day₁.
  3. Fix negative days. If the day difference is negative, borrow one month. Add the number of days in the month before the end date's month (28, 29, 30 or 31), and subtract 1 from the month difference.
  4. Fix negative months. If the month difference is negative, borrow one year. Add 12 to the months and subtract 1 from the years.
  5. Combine. Write the final years, months and days.
  6. Convert to total days. Either count the days directly (365 per ordinary year plus one for each 29 February in the span, plus the remaining months and days), or convert both dates to timestamps and divide the difference in milliseconds by 86,400,000 (24 × 60 × 60 × 1,000). If you use timestamps, use UTC dates to avoid daylight-saving shifts.

Leap years: a leap year has 366 days instead of 365, with February having 29 days. A year is a leap year if it is divisible by 4, except century years, which must be divisible by 400. So 2000 and 2024 are leap years, while 1900 and 2100 are not. Remember this when borrowing days from February.

Advertisement

Age Gap Scenarios Compared

These birthday pairs are illustrative. Totals are exact for the dates shown, using the same borrowing method as above.

Scenario Earlier birthday Later birthday Age gap Total days
Twins 12 April 2010 12 April 2010 0 years, 0 months, 0 days 0
Born a day apart across New Year 31 December 2022 1 January 2023 0 years, 0 months, 1 day 1
Siblings about 2 years apart 10 March 2015 22 May 2017 2 years, 2 months, 12 days 804
Couple about 5 years apart 3 August 1990 18 December 1995 5 years, 4 months, 15 days 1,963
Parent and child about 30 years apart 14 January 1975 9 November 2005 30 years, 9 months, 26 days 11,257

Note that a gap of about 5 years contains 1,826 or 1,827 days depending on how many leap days fall inside it, so converting years to days by multiplying by 365 is only approximate.

FAQ

Does the order of the two people matter? No. The earlier birthday is always treated as the start, so the result is the same either way.

Are leap years handled? Yes. The calendar logic accounts for the actual number of days in each month, including February in leap years.

What does "total days apart" mean? It is the raw count of calendar days between the two dates, useful when you need a single number rather than a years/months/days breakdown.

Last updated:

Most popular in Time and Date

View all Time and Date calculators