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$$
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.
How to Calculate an Age Gap by Hand
- 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.
- Subtract each part separately. Compute year₂ − year₁, month₂ − month₁ and day₂ − day₁.
- 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.
- Fix negative months. If the month difference is negative, borrow one year. Add 12 to the months and subtract 1 from the years.
- Combine. Write the final years, months and days.
- 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.
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.