What this calculator does
The Age Between Two Dates Calculator finds the exact span between a date of birth and a target date, expressed in years, months and days. It also reports the same interval as decimal years, total months plus days, weeks plus days, total days, and approximate hours, minutes and seconds. It uses standard Gregorian calendar arithmetic, so it applies identically everywhere — there are no region-specific rules.
How to use it
Choose a mode under "Calculate". The default Age mode takes a date of birth and a target date and returns the age. Date of Birth mode works in reverse: enter a target date and a known age to recover the birth date. Date of Death mode adds an age to a date of birth. The "Date Format" selector only changes the display order of the fields; it never changes the math.
The formula explained
Age is computed component by component:
$$\text{Age} = \text{EndDate} - \text{StartDate}\ \ (\text{years, months, days with calendar borrow})$$First subtract days: if the result is negative, borrow the number of days in the month before the end month and reduce the month count by one. Then if the month count is negative, borrow twelve months and reduce the year. Component differences are \(d = d_e - d_s,\ m = m_e - m_s,\ y = y_e - y_s\). Total days are computed from day numbers (an ordinal day count) so leap years are handled exactly using the rule: February has 29 days when the year is divisible by 4, except centuries not divisible by 400. The decimal-year value is
$$\text{decimalYears} = \frac{\text{totalDays}}{365.2425}$$
Worked example
Born 1990-03-25, age on 2026-06-15. Years = 36, months = 3, days = \(15 - 25 = -10\). Borrow May (31 days): days = 21, months = 2. Result: 36 years, 2 months, 21 days. Total days = 13,231, decimal years approximately \(\frac{13231}{365.2425} \approx 36.225\), weeks = 1,890 with 1 day left over.
Converting the Age Span Into Other Units
Once the calculator has the total elapsed time, the same span can be expressed in larger or smaller units. The total number of days is the anchor value: weeks, hours, minutes and seconds are exact multiples of a day, while years and months are calendar quantities of variable length, so converting to or from them uses an average.
| Unit | Equals | Notes |
|---|---|---|
| 1 week | 7 days | Exact. |
| 1 day | 24 hours = 1,440 minutes = 86,400 seconds | Exact (ignoring rare leap seconds). |
| 1 hour | 60 minutes = 3,600 seconds | Exact. |
| 1 average month | ≈ 30.4369 days | 365.2425 ÷ 12; used for decimal conversions only. |
| 1 average year | ≈ 365.2425 days | Gregorian mean year; accounts for the 400-year leap cycle. |
Total days → weeks + days
Divide the total day count by 7. The quotient is the number of whole weeks and the remainder is the leftover days:
$$\text{weeks} = \left\lfloor \frac{\text{totalDays}}{7} \right\rfloor, \qquad \text{extraDays} = \text{totalDays} \bmod 7$$
For example, 5,479 days → \(\lfloor 5479/7 \rfloor = 782\) weeks with remainder \(5479 - 782\times 7 = 5\), i.e. 782 weeks and 5 days.
Total days → decimal years and hours
Decimal years use the Gregorian mean year length so a span averages out leap years correctly:
$$\text{decimalYears} = \frac{\text{totalDays}}{365.2425}$$
So 5,479 days ≈ \(5479 / 365.2425 \approx 15.00\) years, and in hours that is \(5479 \times 24 = 131{,}496\) hours.
Key Terms Explained
- Date of birth (start date)
- The earlier of the two dates, from which elapsed time is measured. In Age mode it is supplied directly; in Date of Birth mode it is the unknown the calculator solves for.
- Target / end date
- The later "as-of" date on which the age is evaluated — for a living person this is usually today, but it can be any date such as a future birthday or a historical anniversary.
- Calendar borrow
- The adjustment made when the end day is smaller than the start day, or the end month smaller than the start month. The calculator borrows one month (adding that month's actual number of days) before subtracting days, and borrows one year (adding 12 months) before subtracting months — the same logic as long subtraction, but with variable-length "columns."
- Decimal years
- The whole span expressed as a single fractional number of years, computed from the total day count divided by the mean Gregorian year of 365.2425 days. Useful for charts and averages, but less precise than the years/months/days breakdown for a specific person.
- Ordinal day count (total days)
- The plain number of days between the two dates, found by converting each date to a serial day number and subtracting. It is unaffected by month lengths or leap-year placement and is the basis for the weeks, hours, minutes and seconds conversions.
- Leap year (Gregorian rule)
- A year is a leap year (with a 29 February) if it is divisible by 4, except century years, which must also be divisible by 400. Thus 2000 and 2024 are leap years while 1900 and 2100 are not. This rule keeps the calendar aligned to the solar year and explains the 365.2425-day average.
- Age mode
- Given a date of birth and a target date, returns the elapsed age in years, months and days (plus other units).
- Date of Birth mode
- Given a known age and the date on which that age applied, works backward to find the date of birth.
- Date of Death mode
- Given a date of birth and an age at death (or any final age), adds the age to the birth date to find the corresponding later date.
FAQ
How are leap years handled? Exactly, via the Gregorian rule (divisible by 4, but not 100 unless also 400).
Why are hours, minutes and seconds approximate? No clock time is entered, so those values are based on whole days multiplied by 24, 60 and 60.
What about a Feb 29 birthday in a non-leap year? It is treated as the last valid day of February (Feb 28) by convention.