Two siblings
Paste a small example into the tool and change one part at a time.
The tool shows 2 years, 7 months, 22 days and says the first person is older. Below it: 31 months, 138 weeks and 967 days.
Enter two dates of birth to see how much older one person is, in years, months and days.
Last updated
Enter both dates of birth to see the age gap.
Coddy teaches you by writing real code in your browser - interactive lessons, instant feedback, and AI help when you get stuck.
The age gap between two people never changes: it is the time from the earlier date of birth to the later one. The tool counts it the same way as an age, with whole years, then whole months, then the days left. Siblings born on June 12, 2015 and February 3, 2018 are 2 years, 7 months and 22 days apart for life.
The difference between their ages in whole years does change during the year, and that is what confuses people. Take someone born on March 10, 1990 and someone born on October 20, 1993, 3 years, 7 months and 10 days apart. From March 10 to October 19 the first has had a birthday and the second has not, so their ages differ by 4. The rest of the year they differ by 3.
It works for siblings, couples, a parent and a child, or any two dates from 1900 to 2100. When both dates are the same, it says they were born on the same day. The dates are compared in your browser and not sent anywhere.
Choose the month and the day, and type the year, for the first person.
Do the same for the second person. The order does not matter.
The result shows the gap in years, months and days and says who is older. Below it is the same gap in months, weeks and days.
Pairs of dates of birth and the gap the tool shows for them. The weeks it shows are whole weeks.
| First person | Second person | Age gap | In days |
|---|---|---|---|
| June 12, 2015 | February 3, 2018 | 2 years, 7 months, 22 days | 967 |
| March 10, 1990 | October 20, 1993 | 3 years, 7 months, 10 days | 1,320 |
| November 2, 1985 | April 17, 1991 | 5 years, 5 months, 15 days | 1,992 |
| August 30, 1962 | January 5, 1994 | 31 years, 4 months, 6 days | 11,451 |
| February 29, 2000 | February 28, 2001 | 1 year | 365 |
| May 9, 2012 | May 9, 2012 | 0 days, born on the same day | 0 |
Paste a small example into the tool and change one part at a time.
The tool shows 2 years, 7 months, 22 days and says the first person is older. Below it: 31 months, 138 weeks and 967 days.
Copy the original value, run the tool, then compare the result.
The order does not change the gap: 3 years, 6 months, 15 days, or 1,293 days. The tool says the second person is older.
Take a value from your own work and use this tool to inspect or prepare it.
One year after February 29, 2000 is February 28, 2001, since 2001 has no February 29. The tool shows a gap of exactly 1 year, or 365 days.
from datetime import datefrom dateutil.relativedelta import relativedelta
a = date(1993, 10, 20)b = date(1990, 3, 10)older, younger = sorted([a, b])gap = relativedelta(younger, older)print(f"{gap.years} years, {gap.months} months, {gap.days} days")print(gap.years * 12 + gap.months, "months")sorted puts the earlier date of birth first, so the gap is never negative. It prints 3 years, 7 months, 10 days and then 43 months, as the tool does.
Count from the earlier date of birth to the later one: whole years, then whole months, then days. Enter both dates here and the tool does it and says who is older.
No. The gap is the same either way, and the tool tells you whether the first or the second person is older.
From the older person's birthday until the younger person's birthday, the older one has already gone up a year. In that stretch the ages differ by one more than the whole years in the gap.
A gap of 0 days and the line They were born on the same day. It compares dates, not birth times, so it cannot say which twin is older.
Yes. Under the gap, the tool shows it in months, in whole weeks and in days.