How to Calculate Age Difference Step by Step
The age difference between two people is the time between their birth dates. The formula is simple — subtract earlier from later — but doing it accurately by hand needs one trick: borrowing, so months and days never go negative. Here is the whole method.
The age difference formula
Write both dates as year, month, day. Take the earlier date as the starting point and count forward:
years = later year − earlier year
months = later month − earlier month
days = later day − earlier day
Then fix any negative values by borrowing, as in the steps below.
The hand method, step by step
- List both birth dates (YYYY-MM-DD) and identify who was born earlier.
- Subtract years, then months, then days: earlier values from later values.
- If days is negative, subtract 1 from months and add the number of days in the month before the later date (e.g. June is preceded by May, which has 31 days).
- If months is now negative, subtract 1 from years and add 12 to months.
- The result is the exact difference in years, months and days.
Worked example
Person A was born on 1985-11-30, person B on 1990-06-15. A was born earlier.
- Years: 1990 − 1985 = 5
- Months: 6 − 11 = −5
- Days: 15 − 30 = −15 → borrow: months become −6, days become −15 + 31 (May has 31 days) = 16
- Months negative → borrow: years become 4, months become 6
Result: 4 years, 6 months, 16 days. Check: 1985-11-30 plus 4 years is 1989-11-30; plus 6 months is 1990-05-30; plus 16 days is 1990-06-15. Correct.
Shortcuts and caveats
Subtracting birth years alone gives an approximation that is wrong around birthdays: between birthdays the true difference is one year less. Month-only arithmetic miscounts by up to a month at month boundaries. If you need the exact figure, do the full method or use the age difference calculator, which applies the same rules including leap years and February 29.
For what each input mode gives you, see age difference by birthday and age; for unit conversions, see exact age difference.
Skip the arithmetic
Calculate an age difference now →