Xerobit

Age Difference Calculator: Compare Two Birth Dates

Enter two birth dates to find the exact age difference between two people in years, months and days. This age difference calculator also shows the total days separating them and, as a curiosity, how the pair compares with the half-your-age-plus-seven folk rule. Everything runs in your browser using UTC, so nothing is uploaded.

Result

  • Difference
    4 years, 9 months, 7 days
  • Total days
    1,741
  • Older person
    Person 1 is older
  • Half-your-age-plus-seven (folk rule)
    Person 1 is 35 and Person 2 is 30 as of 2026-01-01. Folk-rule minimum for the younger: 24. Person 2 is at or above it.

    A folk rule of thumb, not advice and not a legal or scientific standard

How to use the age difference calculator

  1. Enter the first person's birth date in YYYY-MM-DD format.
  2. Enter the second person's birth date in the same format.
  3. Optionally set the as-of date used for the folk rule row, or leave it blank for today.
  4. Read the exact age difference in years, months and days, plus the total days.

How the age difference is calculated

The age difference calculator parses each date string into year, month and day components, then constructs a UTC timestamp with Date.UTC(year, month - 1, day). Using UTC avoids any shift caused by local daylight saving time transitions.

To express the gap in years, months and days, the tool counts the whole calendar months that fit between the two dates, then counts the days left over. It adds months to the earlier date and, when the earlier day does not exist in the landing month, uses the last day of that month. For example, comparing 1990-06-15 and 1995-03-22: 57 whole months fit (4 years and 9 months), which lands on 1995-03-15, and 7 days remain. The result is 4 years, 9 months, 7 days.

The month-end rule matters for dates like 2000-01-31 and 2000-03-01. Adding one month to January 31 gives February 29 (the last day of that month), so one whole month fits and 1 day remains: 1 month, 1 day, which is also 30 days in total. Total days are computed separately by dividing the difference of the two UTC timestamps by 86,400,000 milliseconds per day.

Common age gaps at a glance

This table shows typical age differences you might want to compare. Use these as quick references when entering dates into the age gap calculator.

Relationship typeTypical gapExample dates
Siblings close in age1 to 3 years2000-01-10 and 2002-05-15
Parent and child20 to 40 years1970-04-20 and 1998-09-12
Grandparent and grandchild45 to 70 years1940-11-01 and 2005-03-22
Partners with a large gap10 to 20 years1980-07-04 and 1995-12-30

The half-your-age-plus-seven rule

The folk rule says the younger partner should be at least half the older partner's age plus seven years. It is a cultural heuristic, not a scientific guideline, not a legal standard and not advice about any relationship. If the older person is A whole years old, the minimum for the younger person is floor(A / 2) + 7.

For example, if the older person is 30, the folk-rule minimum for the younger is 22. The calculator works out both people's whole-year ages on the as-of date you give (or today if you leave it blank) and reports whether the younger person is at or above that minimum. The row is a curiosity only, and it is shown as not meaningful when the older person is under 14 or when the younger person is not yet born on the as-of date.

Why UTC matters for date math

JavaScript's Date object operates in the user's local time zone by default. When you create a date like new Date(2000, 0, 1), midnight is interpreted in local time. In regions that observe daylight saving time, certain local times do not exist or occur twice, which can shift a calculation by an hour and occasionally change the apparent day count.

By using Date.UTC, every date is anchored to midnight Coordinated Universal Time. This guarantees that subtracting two dates always yields an exact multiple of 86,400,000 milliseconds per day, making the age difference between two people reliable regardless of where the browser runs.

Worked examples

ExampleInputResult
Typical coupleFirst birth date: 1990-06-15; Second birth date: 1995-03-22; Ages as of (optional): 2026-01-01Difference: 4 years, 9 months, 7 days; Total days: 1,741; Older person: Person 1 is older; Half-your-age-plus-seven (folk rule): Person 1 is 35 and Person 2 is 30 as of 2026-01-01. Folk-rule minimum for the younger: 24. Person 2 is at or above it.
Same year siblingsFirst birth date: 2000-01-10; Second birth date: 2000-11-25; Ages as of (optional): 2026-01-01Difference: 10 months, 15 days; Total days: 320; Older person: Person 1 is older; Half-your-age-plus-seven (folk rule): Person 1 is 25 and Person 2 is 25 as of 2026-01-01. Folk-rule minimum for the younger: 19. Person 2 is at or above it.
Large age gapFirst birth date: 1950-07-04; Second birth date: 2000-12-31; Ages as of (optional): 2026-01-01Difference: 50 years, 5 months, 27 days; Total days: 18,443; Older person: Person 1 is older; Half-your-age-plus-seven (folk rule): Person 1 is 75 and Person 2 is 25 as of 2026-01-01. Folk-rule minimum for the younger: 44. Person 2 is below it.
Same birthdayFirst birth date: 1985-09-09; Second birth date: 1985-09-09; Ages as of (optional): 2026-01-01Difference: 0 days; Total days: 0; Older person: Both born on the same day; Half-your-age-plus-seven (folk rule): Not applicable

FAQ

How accurate is this age difference calculator?

It uses exact calendar arithmetic via UTC timestamps, so leap years and varying month lengths are handled correctly. The result in years, months and days matches what you would get counting on a physical calendar.

Does the order of the two dates matter?

No. The tool automatically identifies which date is earlier and labels who is older. You can enter the dates in either order.

What date format should I use?

Enter dates as YYYY-MM-DD, for example 1995-03-22. This ISO 8601 format avoids ambiguity between month-first and day-first conventions.

Is the half-your-age-plus-seven rule scientifically valid?

No. It is a social folk rule with no scientific basis, and it is not advice. The calculator includes it only as a curiosity, clearly labelled as such, and it compares whole-year ages on the as-of date you choose.

Can I use this to find the age gap between historical figures?

Yes. Any valid Gregorian calendar date works, including dates centuries in the past, as long as you enter them in YYYY-MM-DD format.

Are my dates sent to a server?

No. All calculations happen locally in your browser. Nothing is uploaded anywhere.