Age and date difference calculator
Exact age in years, months and days — with the month-end and leap-day cases handled properly.
Getting month ends right is the whole problem
Subtracting two dates sounds trivial and is not, because months are different lengths. From 31 January to 1 March, a naive implementation subtracts the day numbers, gets minus thirty, borrows February's twenty-nine days and reports minus one day. That is not a hypothetical: it is what an earlier version of this page did, and it was caught by testing it against a second implementation over several thousand random date pairs.
The fix is to count forward rather than subtract. Add whole months to the start date without ever passing the end date, then measure the days left over. Counting that way, 31 January to 29 February is one month — which is what anybody would say out loud — where subtracting gives twenty-nine days.
Leap-day birthdays
If you were born on 29 February, most years do not contain your birthday, and there is no single correct answer about when you age. This page treats 29 February as 28 February in a common year, so you turn a year older on the 28th. That matches the convention used by most date libraries and most registries. Some jurisdictions — the United Kingdom among them, for certain legal purposes — treat it as 1 March instead. It is a convention rather than a fact, so it is stated here rather than hidden.
Daylight saving is a real source of off-by-one errors
Counting days by subtracting two timestamps and dividing by the number of milliseconds in a day is wrong twice a year in most of the world. A clock change makes one local day twenty-three or twenty-five hours long, and the division silently loses or gains a day. Every day count here is measured between UTC noon on each date, which is far enough from either edge that no real offset change can reach it.
Both conventions for counting days
"How many days between the 1st and the 5th" has two defensible answers. Four, if you mean the gap — which is what age means, and what you want for a deadline. Five, if you are counting the days themselves, which is what leave requests, hotel bookings and billing periods mean. There is a switch, because guessing which one you meant is how a calculator quietly costs someone a day's pay.
What else you get
The exact age in years, months and days; the same span expressed in months, weeks, days and hours; the day of the week you were born on; and, when you are counting up to today, the date of your next birthday, how many days away it is and which day of the week it falls on.
Any two dates, not just birthdays
Fill in the second date and it becomes a date-difference calculator: how long a project ran, how long until a deadline, how long two events were apart. The arithmetic is identical and the month-end handling matters just as much.
Common questions
How do I calculate age exactly?
Enter your date of birth and leave the second field empty. You get years, months and days up to today, along with the totals in months, weeks, days and hours.
What happens with a 29 February birthday?
This page treats it as 28 February in a common year, so you age on the 28th. That is the most widely used convention, but some jurisdictions use 1 March — it is a convention, not a fact.
Why does 31 January to 28 February give 28 days rather than a month?
Because a month has not passed: one month from 31 January is 29 February in a leap year. On the 29th it becomes exactly one month. Counting forward this way is what avoids the negative-day results that subtracting produces.
Should I count the end date as a day?
For an age or a deadline, no — you want the gap. For leave, hotel nights or a billing period, usually yes. The switch is there because the two answers differ by one and both are correct in context.
Does it handle dates before 1970?
Yes. There is no epoch limit here — any year from the first century onwards works, so historical dates and very old birth dates are fine.
Is my date of birth sent anywhere?
No. Everything is computed in your browser as you type.