Find the exact number of days, weeks, months or years between any two dates with this free date difference calculator. It gives you a detailed breakdown showing years, months and days, plus total days, total weeks and total months. Useful for project planning, age calculations, and deadlines. Enter start and end dates in YYYY-MM-DD format and get results instantly in your browser.
Enter your values to see the result.
Start: 2024-01-01, End: 2024-12-31 → 0 years, 11 months, 30 days — 365 total days
A full calendar year difference.
Start: 2020-02-29, End: 2024-02-29 → 4 years, 0 months, 0 days — 1461 total days
Leap year to leap year, accounting for the extra day.
Start: 2024-03-01, End: 2024-03-15 → 0 years, 0 months, 14 days — 2 total weeks
A simple two-week span within the same month.
Knowing the exact number of days between two dates is a common need. Project managers calculate sprint durations, students count days until exams, and HR departments compute notice periods. While you could count on a calendar, mistakes happen with month boundaries, leap years, and varying month lengths.
This calculator removes the guesswork by giving you a precise breakdown in multiple units simultaneously.
The algorithm uses a three-step approach:
Step 1: Years. Subtract the start year from the end year. If the end month and day haven't reached the start month and day yet, subtract one year.
Step 2: Months. Count the remaining full months. If the end day is before the start day within the month, borrow from the month count and add the days in the previous month.
Step 3: Days. The leftover days are the simple difference after accounting for the month boundary.
For total days, both dates are converted to an absolute day count (counting every day from year 1) and subtracted. This gives the raw number of days, from which total weeks and total months are derived.
This is the "calendar" breakdown — the way you would describe the difference in everyday language. For example, "2 years, 3 months and 5 days."
The raw count of calendar days between the two dates. Useful when you need a single number for averaging, billing, or legal calculations.
Total days divided by 7, rounded down. Common for project planning, pregnancy tracking, and sprint calculations.
Years multiplied by 12 plus the remaining months. Useful for lease agreements, subscription billing, and financial calculations.
Project management — Calculate the duration of a project phase or the time between milestones.
Legal deadlines — Determine exact notice periods, statute of limitations windows, or contract durations.
Education — Count school days, semester lengths, or time until graduation.
Healthcare — Track treatment durations, medication schedules, or gestational age.
Personal planning — Count days until a vacation, anniversary, or retirement date.
All calculations run entirely in your browser. No dates are sent to any server, stored, or logged. The algorithm handles leap years and varying month lengths correctly, producing results that match manual calendar counting.
The calculator first counts the number of full years between the two dates, then the remaining full months, and finally the leftover days. It also computes total days by converting both dates to an absolute day count and subtracting one from the other. Total weeks and total months are then derived from these base values. This approach closely matches how humans count on a calendar and avoids the inaccuracies of simply dividing total days by 365 or assuming 30 days per month.
Yes, the calculator correctly handles leap years when computing the number of days in each month. February 29 in a leap year is counted properly, so date differences spanning leap years are always accurate and match what you would get by counting manually on a calendar.
Use the ISO format YYYY-MM-DD, for example 2024-06-15 for June 15, 2024. The year must be four digits, the month two digits (01–12), and the day two digits (01–31 depending on the month).
No, the end date must be on or after the start date. If you enter an end date before the start date, the calculator will show an error message asking you to correct the input. Simply swap the two dates if needed, since the difference is the same regardless of which one you place in the start or end field.
No, all calculations happen entirely in your browser using client-side JavaScript code. No dates or personal data are transmitted to any server, stored in any database, or logged anywhere. The code runs locally on your device and produces results instantly without any network requests.
Last updated on 2026-09-26 · Written by UtiliaTools