Date Calculator – Find the Difference Between Two Dates
Our free date calculator makes it easy to find the exact number of days, weeks, months, and years between any two dates. You can also add or subtract a number of days from a given date to find a past or future date. Whether you're counting down to an event, calculating a deadline, or figuring out someone's age, this tool handles it all instantly.
Enter the start date in YYYY-MM-DD format.
Required for 'Difference Between Two Dates' mode.
Use a negative number to subtract days. Used in Add/Subtract mode.
Your results will appear here
How to Use This Calculator
1. Choose your calculation mode: select 'Difference Between Two Dates' to find how far apart two dates are, or 'Add / Subtract Days from a Date' to find a date a certain number of days away. 2. Enter your Start Date in YYYY-MM-DD format (for example, 2025-03-15). 3. If calculating the difference, also enter an End Date in the same format. 4. If adding or subtracting days, enter the number of days in the 'Days to Add / Subtract' field — use a negative number to go back in time. 5. Click Calculate to instantly see the result in days, weeks, months, and years, or the resulting date.
How Date Difference Is Calculated
The date calculator finds the difference between two dates by converting both dates to milliseconds since the Unix epoch (January 1, 1970) and subtracting one from the other. The result in milliseconds is then divided by the number of milliseconds in a day (86,400,000) to get the total number of days.
Converting Days to Weeks, Months, and Years
- Weeks: Total days divided by 7, rounded down to the nearest whole week.
- Months: Total days divided by the average month length of 30.4375 days (365.25 ÷ 12).
- Years: Total days divided by 365.25, which accounts for leap years.
Adding and Subtracting Days
To find a date a certain number of days in the future or past, the calculator multiplies the number of days by 86,400,000 milliseconds and adds (or subtracts) it from the start date. JavaScript's Date object then handles all the month and year rollovers automatically.
Why Use an Average Month Length?
Calendar months vary between 28 and 31 days, so converting days to months requires using an average. The standard average is 30.4375 days per month (derived from 365.25 days per year ÷ 12 months). This gives a good approximation for most practical purposes.
Common Use Cases
- Counting down days to a wedding, vacation, or event
- Calculating contract durations and deadlines
- Determining age in days, weeks, or years
- Finding payment due dates by adding days to an invoice date
- Computing project timelines and sprints