Maths
How to Calculate Exact Age and the Difference Between Two Dates
How to calculate exact age in years, months and days, plus the number of days between two dates, with borrowing, leap years and worked examples.
By Vigneshwaran M · 2026-10-03 · 5 min read
Your age on a given day is the number of full years since your birth date, plus the leftover months and days. The gap between any two dates works the same way. It sounds simple until months have different lengths and leap years appear. This guide shows a reliable method with worked examples, so you can verify any result from the age calculator.
Method: subtract year, month and day, then borrow
Write both dates as year, month and day. Subtract the earlier date from the later one in three columns, starting with days. If a column goes negative, borrow from the column to its left.
- If the day difference is negative, add the number of days in the month before the later date's month, and reduce the month difference by 1.
- If the month difference is negative, add 12 and reduce the year difference by 1.
Worked examples
Example 1: no borrowing needed
Born 14 August 1995. Date to calculate: 3 October 2026.
- Years: 2026 − 1995 = 31
- Months: 10 − 8 = 2
- Days: 3 − 14 = −11, which is negative, so borrow
Borrow a month: September has 30 days, so days = −11 + 30 = 19 and months = 2 − 1 = 1.
Result: 31 years, 1 month, 19 days.
Check by counting forward: 14 August 1995 plus 31 years is 14 August 2026. To 14 September is 1 month. From 14 September to 3 October is 16 days left in September (30 − 14) plus 3, which is 19 days. The two methods match.
Example 2: borrowing across a year
Born 28 November 2000. Date to calculate: 10 March 2026.
- Years: 2026 − 2000 = 26
- Months: 3 − 11 = −8
- Days: 10 − 28 = −18
Fix days first. The month before March is February, and in 2026 it has 28 days. Days = −18 + 28 = 10, and months = −8 − 1 = −9. Months is still negative, so add 12: months = 3, and years = 26 − 1 = 25.
Result: 25 years, 3 months, 10 days.
Check forward: 28 November 2000 plus 25 years is 28 November 2025. Add 3 months to reach 28 February 2026, then 10 more days reaches 10 March 2026 (28 February to 1 March is one day, so to 10 March is ten). It matches.
Counting the days between two dates
For a total number of days, count days within the year for each date and subtract. For the same year this is easy.
Example: 12 January 2026 to 25 March 2026.
- Day number of 12 January = 12
- Day number of 25 March = 31 + 28 + 25 = 84
- Difference = 84 − 12 = 72 days
Cross-check by pieces: the rest of January after the 12th is 19 days, February adds 28, and March adds 25. 19 + 28 + 25 = 72. As weeks, 72 days is 10 weeks and 2 days (72 = 7 × 10 + 2).
Leap years
A leap year has 366 days, with 29 days in February. The rule: a year divisible by 4 is a leap year, except century years, which must be divisible by 400. So 2024 and 2000 are leap years, while 1900 and 2100 are not.
Example: 15 February 2024 to 15 March 2024.
- Day number of 15 February = 31 + 15 = 46
- Day number of 15 March = 31 + 29 + 15 = 75
- Difference = 75 − 46 = 29 days
In a non-leap year the same span would be 28 days. If your date range crosses a 29 February, your count must include it.
Inclusive or exclusive counting
Subtracting gives the elapsed days between the dates. If you also want to count both the start day and the end day, as in "how many days is a booking from the 10th to the 14th", add 1. From 10 to 14 is 4 days elapsed, or 5 days counting both ends. Decide which meaning you need before you start, and say which one you used.
Birthdays on 29 February
People born on a leap day have a birthday only every fourth year. In other years the age is usually considered to advance on either 28 February or 1 March, depending on the context. Legal and administrative systems may have a specific rule, so check the one that applies to you.
Common mistakes
- Using 30 days for every month. Borrow with the real length of the right month, which is the month before the later date's month.
- Forgetting that the day count is relative to the later date. Borrowing uses the previous month of the later date, not of the birth date.
- Ignoring leap years when a range crosses 29 February.
- Mixing inclusive and exclusive counting.
- Entering dates in the wrong order or format. Day-month-year and month-day-year can swap values for dates like 03/10.
Quick checklist
- Put the later date on top and the earlier date below.
- Subtract days, then months, then years.
- Borrow with the correct month length.
- Check by counting forward from the earlier date.
- Decide whether the end day is counted.
Tools and related reading
The age calculator gives years, months and days instantly and is handy for checking your hand results. If you want to turn a day count into a share of a year or a change over time, the percentage calculator pairs well with it.
For anything official, such as eligibility by age on a cut-off date, use the date and counting rule stated by the organisation concerned.