Skip to content

Family and relationships

How to Calculate the Age Difference Between Two People

Learn how to calculate the exact age difference between two people, with formulas, worked examples, and results in years, months, and days.

Quick answer

Two people born in 1990 and 1995 are not automatically five years apart. Put the earlier birth date first, then count whole years, whole months, and leftover days forward to the later date. This guide works the method by hand, verifies it three ways, and shows what the gap means at every life stage.

The Age Difference Calculator on this site gives you the answer in seconds: two birth dates in, the exact gap out.

This post is the guide behind that answer: the method, worked by hand with original examples; the verification, three ways; and what the gap means once you have it. The calculator is the tool. This post is the understanding.

To calculate the exact age difference between two people, compare their complete dates of birth rather than only their birth years. Put the earlier birth date first, because it belongs to the older person, then count the calendar interval from that date to the later birth date in years, months, and days.

Two people born in 1990 and 1995 are not automatically exactly five years apart. Their birth months and days decide the precise gap.

Two gold calendar pages side by side with a gold double-headed arrow between them on a deep pine green background
Two gold calendar pages side by side with a gold double-headed arrow between them on a deep pine green background.

The Age Difference Formula

The formula is a subtraction: Age Difference = Later Birth Date − Earlier Birth Date. The earlier birth date belongs to the older person and the later birth date belongs to the younger person.

You are measuring the calendar interval between those two dates, not the difference between two ages. That distinction matters: the interval is fixed for life, while each person’s age keeps changing.

If you only subtract the birth years, you get a rough gap. For an exact age difference, the month and day must also be counted. The worked examples below show why, and the boundary table shows how far the shortcut can stray.

How to Calculate an Age Difference by Hand

A practical way to calculate an age difference by hand is to treat the two dates like a calendar subtraction problem: work through the days, months, and years, borrowing from the next-higher column whenever a value is too small to subtract.

This uses the same calendar borrowing mechanics as calculating age from a date of birth; see our guide on how to calculate age for the full explanation.

Table 1 · The Four Steps
Step What to Calculate Adjustment if Needed
1 Put the birth dates in order Earlier date of birth comes first
2 Subtract the days Borrow the actual length of the preceding month if needed
3 Subtract the months Borrow 12 months from the year if needed
4 Subtract the years Use the adjusted year after any borrowing

Step 1: Put the Two Birth Dates in Order

First determine which date of birth is earlier. The person with the earlier date of birth is older. The person with the later date of birth is younger.

Calculate forward from the earlier date to the later date. Keeping the dates in this order makes the result easier to interpret and avoids accidentally producing a negative difference.

Step 2: Calculate the Difference in Days

Start with the day numbers. If the day in the later birth date is smaller than the day in the earlier birth date, borrow the actual number of days in the preceding calendar month (28, 29, 30, or 31) before subtracting.

The preceding month is the month before the later date’s month, not the month before the earlier date’s month.

Step 3: Calculate the Difference in Months

After resolving the days, subtract the month numbers. If the adjusted month in the later date is smaller than the month in the earlier date, borrow 12 months from the year, then subtract normally.

Step 4: Calculate the Difference in Years

Finally, subtract the earlier year from the adjusted later year. Combine the three parts to give the final result: X years, Y months, Z days. Keeping the components separate matters because calendar months do not all contain the same number of days.

Worked Examples

The easiest way to understand the method is to see both a simple calculation and one that requires borrowing.

Example 1: Calculation Without Borrowing

Suppose the two dates of birth are: older person, June 8, 1988; younger person, October 19, 1994. No borrowing is required.

Table 2 · Example 1: June 8, 1988 to October 19, 1994
Component Calculation Difference
Days 19 − 8 11 days
Months 10 − 6 4 months
Years 1994 − 1988 6 years

Exact age difference: 6 years, 4 months, and 11 days. Counted day by day, that is 2,324 days, or 76 total months, or 332 weeks exactly.

Example 2: Calculation With Borrowing

Now consider a more difficult example: older person, September 27, 1989; younger person, February 14, 1996. Days: 14 is smaller than 27, so borrow January 1996’s 31 days: 14 + 31 = 45, and 45 − 27 = 18 days.

Months: borrowing reduced February to January (month 1), so borrow 12 months from the year: 1 + 12 = 13, and 13 − 9 = 4 months.

Years: 1995 − 1989 = 6 years. Exact age difference: 6 years, 4 months, and 18 days. Counted day by day, that is 2,331 days, or 76 total months, or 333 weeks exactly.

Why Subtracting Birth Years Is Only an Estimate

Subtracting the two birth years is useful for a quick estimate, but it ignores the month and day of each birthday. The table below shows how far it can stray.

Table 3 · Birth-Year Subtraction vs the Exact Gap
Earlier Date of Birth Later Date of Birth Birth-Year Subtraction Exact Calendar Difference
December 30, 1987 January 2, 1993 6 years 5 years, 0 months, 3 days
January 3, 1987 December 29, 1992 5 years 5 years, 11 months, 26 days

In the first example, subtracting the years overstates the gap by almost a year. In the second, it understates it by almost a year. The shortcut is fine for a rough answer, but not when you need the exact difference between two dates of birth.

Common Mistakes When Calculating Age Difference

Using only the birth years: this ignores the birth months and days. Assuming every month has 30 days: calendar months contain 28, 29, 30, or 31 days. Borrowing from the wrong month: when borrowing days, the relevant calendar month is the one before the later date’s month, not the one before the earlier date’s month.

Forgetting leap years: February can contain 29 days instead of 28, and a gap that crosses a leap February is a day longer than the same gap in a common year.

Mixing calculation methods: month-end date arithmetic can be represented differently by different software systems. Use one convention consistently. Reversing the birth dates: put the earlier date of birth first if you want a positive age gap and a clear older-to-younger comparison.

Rounding too early: do not turn several months into a fraction of a year before finishing the calendar calculation. Using an ambiguous date format: a date such as 03/04/1990 can mean March 4 or April 3 depending on local convention. Writing the month name or using the unambiguous YYYY-MM-DD format avoids confusion.

Special Cases When Comparing Two Birth Dates

Most date-of-birth comparisons are straightforward once the calendar arithmetic is clear, but several edge cases deserve extra attention.

Same Date of Birth

If two people have exactly the same date of birth, their calendar age difference is 0 years, 0 months, and 0 days. Birth times could distinguish who was born first, but birth time is outside a standard date-of-birth age difference calculation.

Same Birthday in Different Years

If two people were born on the same month and day but in different years, the age difference is normally a whole number of years. For example, April 10, 1990 to April 10, 1995 is exactly five calendar years.

Dates Near the End of a Month

Month-end dates need care because months have different lengths. January 31, February 28, February 29, April 30, and other month-end dates do not behave like equally sized 30-day blocks. Different software libraries can also express some end-of-month intervals differently.

One system treats January 31 to February 28 as one completed calendar month, while a manual column-borrowing method describes the elapsed interval differently. For that reason, use one calculation convention consistently when comparing month-end dates, especially if you are checking a manual result against a calculator.

February 29 and Leap Years

February normally has 28 days, but it has 29 days in a Gregorian leap year. In the Gregorian calendar, years divisible by 4 are generally leap years, except century years unless they are also divisible by 400.

This affects calendar subtraction when the interval crosses February in a leap year, as shown in the borrowing example above.

A person born on February 29 also creates a special birthday case in non-leap years: February 29, 2000 to February 28, 2025 is 24 years, 11 months, and 30 days, while February 29, 2000 to March 1, 2025 is exactly 25 years.

Different legal systems, applications, and date-calculation conventions use different rules for treating that birthday outside a leap year, so an age-difference guide should not assume that February 28 or March 1 is universally the correct substitute.

Does the Age Difference Between Two People Change Over Time?

The actual interval between two dates of birth does not change. If two people were born 3 years, 2 months, and 10 days apart, that birth-date interval remains the same as both people get older. What can change is the difference between their displayed whole-number ages.

Suppose one person has already had a birthday this year but the other person has not. Their ages shown only as whole years temporarily appear one year farther apart or closer together. That does not mean the true age gap changed. It only reflects where each person is in the current birthday cycle.

How to Check Your Age Difference Calculation

After calculating the age gap manually, check the result instead of assuming the arithmetic is correct. There are three independent ways to do it.

First, add the calculated interval back to the earlier birth date using the same calendar convention. If the result reaches the later birth date, the calculation is internally consistent. Using the borrowing example: September 27, 1989 + 6 years + 4 months + 18 days = February 14, 1996.

Second, subtract the Julian Day Numbers. Each calendar date maps to one serial day number (January 1, 2000 is 2,451,545), and subtracting the two serials gives the exact total elapsed days with no month-length conventions involved.

The flagship example below: March 22, 1978 is 2,443,590 and November 9, 1984 is 2,446,014, a difference of 2,424 days, which matches the total-days figure.

Free converters publish the formula, so you can verify the total-days figure on paper: if your tool’s total days disagree with the serial subtraction, the tool or your data entry is wrong, never the arithmetic.

For the years-months-days form, also add the interval back to the earlier birth date by hand; if you do not land exactly on the later date, the month borrowing was off.

Third, enter both dates into an Age Difference Calculator and compare its result with your manual answer. For month-end or February 29 cases, make sure the calculator and your manual method use the same calendar convention before treating a different decomposition as an arithmetic error.

Age Difference in Years, Months and Days vs Total Days

An age difference can be expressed in more than one useful way.

Table 4 · Two Formats for the Same Gap
Format What It Represents Example
Years, months, and days A calendar-based decomposition of the interval 6 years, 4 months, 11 days
Total days The complete elapsed interval counted only in days 2,324 days

For the example from June 8, 1988 to October 19, 1994, the age difference can be expressed as 6 years, 4 months, and 11 days or as 2,324 total elapsed days. These formats describe the same overall span in different ways.

You should not convert the calendar result into total days by assuming every month has 30 days or every year has 365 days, because real calendar months and leap years vary in length.

What a 7-Year Gap Means at Every Life Stage

Every calculator computes the gap. None interpret it. A fixed 7-year gap means completely different things depending on where the two people are in life.

Table 5 · A 7-Year Gap at Every Life Stage
Younger Older Gap What it means
3 10 7 years One in preschool, one in 5th grade; different worlds
15 22 7 years One in school, one graduated and working
28 35 7 years Both adults; the gap barely registers socially
45 52 7 years Both mid-career; the gap is a footnote
68 75 7 years One retired, one still working; the gap matters again

The number never changes. Its meaning does. That is why the raw gap is only half the answer.

Worked Example: Born March 22, 1978 and November 9, 1984

Put the earlier date first: March 22, 1978 is the older person. Years: March 22, 1978 to March 22, 1984 = 6 years. Months: March 22, 1984 to October 22, 1984 = 7 months.

Days: October 22 to November 9, 1984: 9 + 31 − 22 = 18 days. Gap: 6 years, 7 months, 18 days = 79 months = 2,424 days = 346 weeks and 2 days. As a decimal, 2,424 ÷ 365.25 = 6.637 years.

Rules Worth Knowing

Earlier date first

Always put the earlier birth date first. That person is the older one. Then count whole years, whole months, and leftover days in that order.

Month-end clamping has legal backing

One month after January 31 is February 28 (or 29 in a leap year), not March 3. Taiwan’s Civil Code Article 121 counts periods the same way, and Scotland’s Age of Legal Capacity Act 1991 (section 6) treats February 29 birthdays as March 1 in non-leap years.

The gap stays, the ratio shrinks

The gap never changes, but the ratio between the two ages keeps shrinking over life.

A 7-year gap at 7 and 14 is a 2.0-to-1 ratio; at 35 and 42 it is 1.2 to 1; at 70 and 77 it is 1.1 to 1. The number stays put. The ratio collapses toward 1 as both people age.

Twins across midnight

Twins born either side of midnight get a 1-day gap in whole-day math. Take twins born at 11:48 PM on December 31 and 12:06 AM on January 1: eighteen minutes apart in real time, one calendar day apart on paper. Same-date twins get zero. Day-level precision cannot separate what hours could.

Time zones cannot change the answer

Dates are never turned into times of day, so time zones and daylight saving cannot shift the result. A baby born at 11:30 PM on March 3 in New York was born at 4:30 AM on March 4 in London, but the birth certificate still says March 3, the local calendar date.

Record each birth’s local calendar date rather than converting both to one zone, because a UTC conversion can push a near-midnight birth onto the wrong calendar day.

How This Guide Compares

Three age-difference guides rank for the same query, and each one covers the gap a little differently. The table below shows which one verifies its answer and which one stops at the calculator.

Table 6 · Age Difference Guides Compared
Feature This guide CalculatorPark EZ Calculators CalculateItNow
Worked examples with original dates and totals Yes Yes Yes Yes
Three-way verification (add-back, JDN, calculator) Yes Not shown Not shown Not shown
Software differences (Python, Excel, JavaScript) Yes Not shown Not shown Not shown
Rounding conventions stated Yes Not shown Not shown Not shown
Life-stage table for the gap Yes Not shown Not shown Not shown
Half-your-age-plus-seven rule Not shown Not shown Yes Yes
Age-difference calculator on the page No Yes Yes Yes
Open to read, no account needed Yes Yes Yes Yes

What is missing here: the page has no calculator of its own, so it points to the Age Difference Calculator instead. EZ Calculators and CalculateItNow both cover the half-your-age-plus-seven rule, which this guide leaves out.

Sources

Frequently Asked Questions

Should I round the components or the total? What rounding conventions exist?

Round only after the exact calculation is finished, and state which convention you used, because the conventions disagree. Censuses and most legal contexts truncate down to completed years (“age last birthday”): 5 years, 11 months, 30 days becomes 5.

Life insurers often do the opposite and use “age nearest birthday,” rounding 5 years, 7 months up to 6. Researchers usually avoid both by converting total days into decimal years (total days ÷ 365.25).

Never round the months first and then the years, because rounding 11 months up to a year before finishing the subtraction can fabricate a whole extra year.

Why do Python, Excel, and JavaScript give different age differences for the same dates?

Because no standard defines how a month-end gap becomes “months,” each library invents its own rule. A concrete case: from January 31, 2023 to February 28, 2023. Python’s dateutil.relativedelta reports 0 months and 28 days, because it refuses to count a month it cannot complete.

Excel’s DATEDIF with “M” also reports 0 completed months, while DATEDIF with “MD” reports 28 days, but some spreadsheet templates instead clamp February 28 to the boundary and print “1 month.” JavaScript’s date-fns intervalToDuration likewise gives months: 0, days: 28.

None of them is buggy; they encode different answers to the question the body leaves open, which is why you must record which tool produced a published figure.

What should a calculator do when the later date is entered first?

A well-designed calculator should never silently produce a negative or mixed-sign result.

The three common behaviors are: swap the dates automatically and report a positive gap with older/younger labels (the friendliest option for an age tool);

Refuse with an error, as Excel’s DATEDIF does by returning #NUM! when the start date comes after the end date; or return a signed duration, as SQL’s DATEDIFF does (negative day counts).

If you do report a signed interval, put the minus sign on the whole duration, ISO 8601 writes -P3Y2M, never a mix of positive and negative components, and always label which date is the start so readers do not mistake a reversed entry for a real negative age gap.

How do researchers and banks express an age difference as a fraction of a year?

By converting elapsed days into a decimal fraction of a year, but even the denominator is a convention. Medical researchers and growth charts typically divide total days by 365.25, the average Gregorian year, so a 2,424-day gap is about 6.637 years. Astronomers use the Julian year of exactly 365.25 days for the same purpose.

Banks go further and pick a day-count convention per contract: “30/360” pretends every month has 30 days, while “Actual/365” counts real days. That means the same two dates can yield slightly different fractional years in a loan document, a clinical trial, and an astronomy paper, so always name the divisor alongside the decimal.

Do time zones or birth times change the age difference?

Not at the date level, but they can change which date you feed the formula.

Hospitals record the local time of birth, so a baby born at 11:30 PM on March 3 in New York was born at 4:30 AM on March 4 in London; the birth certificate still says March 3, the local calendar date.

Age-difference tools compare calendar dates only, so time zones do not alter the result once the dates are fixed.

The practical lesson: when the two people were born in different time zones, record each birth’s local calendar date rather than converting both to one zone, because a UTC conversion can push a near-midnight birth onto the wrong calendar day.

How can I check an age difference without trusting any single tool?

Cross-check with a method that no single calculator controls: the Julian Day Number subtraction. Each calendar date maps to one serial day number (January 1, 2000 is 2,451,545), and subtracting the two serials gives the exact total elapsed days with no month-length conventions involved.

Free converters publish the formula, so you can verify the total-days figure on paper: if your tool’s total days disagree with the serial subtraction, the tool or your data entry is wrong, never the arithmetic.

For the years-months-days form, also add the interval back to the earlier birth date by hand; if you do not land exactly on the later date, the month borrowing was off.

Age Difference Calculator: The tool that gives you the answer in seconds.

How to Calculate Age From Date of Birth: Working an age out by hand, with the borrowing method.

What Is Chronological Age?: How completed years work, and the completed-years rule.

Calendar Age vs Total Days Lived: The days inside a calendar age, and where the count breaks.

Month-End Birthday Age Calculation: What happens to the 31st when February has no 31st.

Can You Find a Date of Birth From Someone’s Age?: Finding a birth date from an age, days first.

Methodology: The rules behind each age, written out in one place.