Calculate age

How We Calculate Age – Method, Leap Years & Test Cases

This page explains exactly how results are produced, so you can check them yourself.

The method

  1. Count whole months between the two dates. Subtract one month if the later date’s day is earlier than the start day.
  2. Years are whole months divided by 12. The remainder is the months value.
  3. Move the start date forward by those whole months. The days value is the number of calendar days from that point to the end date.
  4. Totals (days, weeks, hours, minutes, seconds) come from the exact number of calendar days between the dates.

Edge-case rules

Verified test cases

FromToResultTotal days
1990-08-152026-10-2636y 2m 11d13,221
2000-01-012026-10-2626y 9m 25d9,795
1985-05-202026-05-2041y 0m 0d14,975
2000-02-292025-02-2825y 0m 0d9,131
2000-02-292025-03-0125y 0m 1d9,132
2024-01-312024-03-010y 1m 1d30
2023-12-312024-01-010y 0m 1d1

Why other tools differ

Tools that use 365.25 days per year and 30.44 days per month give approximate months and days. Ours counts calendar months, so results can differ by a few days from those tools.

Try it: age calculator · age difference calculator. Last reviewed November 10, 2026.