Age Difference Calculator

Age difference calculator between two birthdates.

Time & Date Leap-year aware y/m/d output
Rate this calculator · 5.0 (1)

Age Difference Calculator

years · months · days · who is older · total days · half-age-plus-seven rule

Instructions — Age Difference Calculator

1

Enter both dates of birth

The two date pickers stack vertically rather than sitting side by side. Pick or type each date in your local format — the calculator reads ISO 8601 internally, so the day after February 28 in a non-leap year is always March 1 and the day after February 29 in a leap year is March 1 again. Order does not matter; the calculator swaps the dates internally so the older person is reported first.

2

Read the age gap headline

The big number breaks the difference into years, months and days, using the same calendar-aware borrowing convention Microsoft Excel uses for DATEDIF and PHP uses for DateInterval. January 31 to February 28 reads as exactly one month, because the calendar runs from end-of-month to end-of-month. Below the headline you also get total months, total weeks, decimal years and the raw total day count.

3

Check the half-age-plus-seven note

The grid shows the "half your age plus seven" rule applied to the older person's current age. That is the smallest age that the popular dating-etiquette heuristic considers acceptable. It is a cultural rule of thumb, not a scientific finding — the original 1901 source treats it as social convention.

Use the calculator for non-relationship questions too. Sibling spacing, classroom cohort gaps, eligibility for sequential beneficiary rules and parent-child age differences are all easier to read than mental arithmetic across leap years.
The U.S. Census Bureau reports a median age gap of 2.2 years between opposite-sex spouses in 2022. Half of all married couples are within 2 years of each other.

Formulas

The calculator subtracts year from year, then month from month, then day from day, and borrows when a difference goes negative. The trick is which month to borrow from — the calendar-anchored convention uses the days in the month preceding the later date.

Years, months, days
$$ Y = y_2 - y_1, \quad M = m_2 - m_1, \quad D = d_2 - d_1 $$
Compute each component independently first; the rest is borrowing.
Borrow days
$$ \text{if } D < 0:\; D \mathrel{+}= \text{daysIn}(m_2 - 1);\; M \mathrel{-}= 1 $$
When the later day is smaller than the earlier day, borrow the days in the previous calendar month of the later date. That preserves the "same calendar day" meaning of one month.
Borrow months
$$ \text{if } M < 0:\; M \mathrel{+}= 12;\; Y \mathrel{-}= 1 $$
Standard year-month borrow. After this step Y, M and D are all non-negative.
Total days
$$ \Delta d = \left| t_2 - t_1 \right| / 86400 $$
Subtraction in milliseconds (Unix epoch), divided by seconds-per-day. Local-midnight times avoid timezone drift.
Decimal years
$$ y_{\text{dec}} = \frac{\Delta d}{365.2425} $$
The Gregorian average year length: a 400-year cycle has 97 leap years for 146,097 days, giving 365.2425 days per year on average.
Half-age plus seven
$$ \text{min\_age} = \frac{a}{2} + 7 $$
Popularised as a social heuristic in Max O'Rell's 1901 book. No academic basis, but a frequently asked "is this gap socially acceptable" benchmark.

Reference

Average spouse age gap, United States
Couple typeMedian gapWithin 2 yrs
Opposite-sex marriages, 2022 (Census ACS)2.2 years~51%
First marriages1.8 years~56%
Remarriages (one or both previously married)4.5 years~32%
Same-sex marriages, U.S. average~5–7 years~30%
Opposite-sex marriages, 1880~4.9 years

Half-your-age-plus-seven, by current age

The social heuristic from Max O'Rell, 1901. Treat as conversational, not scientific. The rule has no maximum-age counterpart in common use.

Younger end
Your ageHalf + 7
1816.0
2218.0
2519.5
3022.0
3524.5
4027.0
5032.0
6037.0
Older end (inverse)
Your age(a−7)×2
1822
2230
2536
3046
3556
4066
5086
60106

Pew Research and the U.S. Census Bureau both publish age-gap distributions for U.S. couples. Both report that the share of couples close in age has grown substantially since the late 19th century.

Article — Age Difference Calculator

Age difference: a practical guide to dating, sibling and partner gaps

An age difference calculator takes two dates of birth and returns the gap in years, months and days, plus the total in months, weeks and days. The U.S. Census Bureau reports a median age difference of 2.2 years between opposite-sex spouses in 2022, with about 51 percent of married couples within two years of each other. The popular "half your age plus seven" rule, which appears in a 1901 etiquette book by Max O'Rell, gives the floor of the conventionally acceptable range; for a 30-year-old that floor is 22.

The calculator handles leap years and short months the same way Microsoft Excel's DATEDIF function and PHP's DateInterval handle them: borrow from the calendar, not from a fixed 30-day month.

What the age difference calculator does

Enter two dates of birth. The order does not matter — the calculator detects which person is older and reports the gap from older to younger. The headline shows years, months and days; the grid below adds full years, decimal years (total days divided by 365.2425, the long-run average Gregorian year length), total months, total weeks and total days. A final cell shows the "half your age plus seven" floor applied to the older person's current age.

The two date inputs stack vertically rather than sitting side by side. That is deliberate: the calculator column on this site is narrow, and date pickers (with their built-in calendar icon) overflow side-by-side on most screens.

The math, in one line
Y = year2 - year1 borrow if needed
M = month2 - month1 borrow 12 if negative
D = day2 - day1 borrow daysInPrevMonth if negative

How the date math works

The calculator subtracts year from year, then month from month, then day from day, and borrows when a difference goes negative. The trick is which month to borrow from. The calendar-anchored convention borrows the days in the month preceding the later date. So January 20 to March 5 borrows 28 days from February (29 in a leap year). January 31 to February 28 reads as exactly one month and zero days, because the calendar runs end-of-January to end-of-February.

This is the same convention Microsoft Excel uses for DATEDIF with the "YMD" unit, the same convention PHP DateInterval uses by default, and the same convention R's lubridate package uses. Different conventions exist; some legal systems treat one month as exactly 30 days, which gives different answers in February. The calendar-anchored form matches how most people read "one month" in plain English.

Did you know

Karam Chand of the UK, who lived to 110 and reportedly outlived his wife by several decades, illustrates how long-term age-gap couples can stretch shared decades. Better-documented modern cases include Dennis Quaid (then 66) and Laura Savoie (then 27), 39 years apart at their 2020 marriage. Cher and Alexander Edwards, who began dating in 2022, share a similar 39-year gap. Across all U.S. marriages, only about 8 percent of opposite-sex couples have a gap of 10 years or more.

Average age difference between couples

The U.S. Census Bureau's 2022 American Community Survey reports a median age difference of 2.2 years between opposite-sex spouses. First-time marriages have the smallest median gap (1.8 years); remarriages run wider (4.5 years). Pew Research finds the share of couples close in age has grown substantially since the late 19th century — in 1880 the median gap was around 4.9 years, more than double today's figure.

Same-sex couples in the U.S. show a wider distribution, with median gaps of 5 to 7 years. Globally, Pew reports that wives are younger than husbands in nearly every country surveyed; the gap is smallest in northern Europe (under two years) and widest in parts of sub-Saharan Africa and the Middle East.

The half your age plus seven rule

Half-your-age-plus-seven says the youngest age you should date is half your age plus seven. A 30-year-old's floor is 22. A 40-year-old's is 27. A 50-year-old's is 32. The inverse, (your age minus seven) times two, gives an upper bound, but the inverse is rarely used. The phrase appears in Max O'Rell's 1901 book "Her Royal Highness Woman" and was later popularised in American newspaper columns and in the autobiography of Malcolm X.

It is a social heuristic, not a scientific result. Research finds actual dating preferences only loosely follow the rule; it underpredicts female minimums in most surveys. It says nothing about emotional, financial or life-stage compatibility, which most relationship research finds matter more than absolute age.

Tip

The calculator applies half-your-age-plus-seven to the older person's age today, not the age at any historical time. So a relationship that began when the older person was 35 (floor: 24.5) keeps the same headline gap forever, but the floor moves with age. The rule is a conversation-starter, not a verdict.

Age difference between siblings and children

The same calculator works for sibling spacing. Pew Research data on U.S. family structure shows median sibling spacing of about 2.5 years between the first and second child, slightly more between later children. Pediatric guidance from the American Academy of Pediatrics suggests an 18-month minimum interpregnancy interval to reduce risks; intervals shorter than 6 months carry the strongest evidence of elevated risk to mother and baby.

Parent-to-child age difference also draws on the calculator. Median age at first birth in the U.S. has risen from about 21 in 1970 to 27 in 2024. The Library of Congress's coverage of Korea's 2023 switch from traditional age counting to international age counting is a reminder that "how old someone is" depends on the system: under the old Korean rule, a baby born December 31 became 2 years old the next day.

Most countries set an absolute age of consent rather than an age-gap rule, but several common-law jurisdictions add close-in-age exceptions (Romeo-and-Juliet clauses) for partners within a defined gap. Canada allows 5 years for 14- and 15-year-olds and 2 years for 12- and 13-year-olds. Several U.S. states have similar carve-outs. The legal landscape is jurisdiction-specific.

Age difference and relationship outcomes

Pooled studies, including a widely-cited 2014 Atlanta-based analysis of 3,000 couples, find that relationship satisfaction does not vary much with absolute age gap in the first few years. Long-run outcomes are more sensitive: couples with gaps of 10 years or more show higher divorce rates in some Western samples, but most of that effect is explained by other factors that correlate with large gaps (remarriage status, religious context, socioeconomic mismatch). Age gap alone is a weak predictor; shared values and communication are stronger.

Common age difference pitfalls

The most common arithmetic mistake is treating one month as exactly 30 days. It is not; calendar borrowing matters. The second is forgetting leap years. Someone born February 29 has a birthday every four years on the calendar but ages every year in law; the calculator handles this by using each date as-is, so February 29 plus one year reads as February 28 in non-leap years, March 1 in some legal definitions. The third mistake is conflating the gap (a number) with social acceptability (a context-dependent judgement). The calculator gives you the first; the second is yours.

FAQ

Subtract the earlier date of birth from the later one. The result has three parts: years, months and days. The calculator handles leap years and short months automatically — for example, someone born February 15 2000 is exactly 25 years and 3 months older than someone born May 15 2025, regardless of leap years in between.
In the U.S., the median age gap between opposite-sex spouses in 2022 was 2.2 years, with husbands typically older (per U.S. Census Bureau ACS data). About 51% of married couples are within 2 years of each other. Same-sex couples show a wider distribution, with a median gap of roughly 5–7 years.
The social heuristic says the youngest age you should date is (your age ÷ 2) + 7. A 30-year-old's minimum is 22; a 40-year-old's is 27. The phrase appears in Max O'Rell's 1901 book "Her Royal Highness Woman" and was later popularised in the U.S. as a dating rule of thumb. It has no scientific backing; it is conversation, not psychology.
It uses the same convention Excel's DATEDIF and PHP DateInterval use: the difference is the number of full calendar units between the two dates. Someone born March 14 2000 turns 25 on the morning of March 14 2025, not midnight before. The day-count cells also report the raw difference in days for cases where inclusive counting matters.
Borrowing uses the actual day count of each calendar month, so February has 29 days in a leap year and 28 otherwise. The decimal years cell divides total days by 365.2425, which is the Gregorian calendar's long-run average year length (97 leap years per 400-year cycle of 146,097 days).
Among well-documented couples, Dennis Quaid (then 66) and Laura Savoie (then 27) were 39 years apart at their 2020 marriage. The largest verified marriage age gaps are around 70–80 years and tend to make news in regional press; they are not common.
The calculator returns zero years, zero months and zero days, and the "older person" row blanks. Two people born on the same calendar date have no age difference, even if hours and minutes differ — the calculator uses local midnight for both inputs.
Months are unequal in length, so "one month from January 31" is ambiguous: it could mean February 28, February 29 (in a leap year), or March 3 (30 days). The calculator uses the calendar-anchored rule (end-of-January to end-of-February equals exactly one month), which matches Excel, PHP, R's lubridate package and the common-sense reading. Some legal contracts define a month as exactly 30 days, which gives different answers.
In most contexts yes, but a few legal systems use the older "completing the year" rule. Until 1969 in England, a person was treated as completing their year at the start of the day before their birthday; the Family Law Reform Act 1969 aligned the legal definition with the popular one. A small number of U.S. state cases still reference the older rule in narrow contexts.
No. The calculator detects which date is earlier and reports the gap from that one to the later one. The headline always labels which person is older, regardless of which input you typed first.