Days Between Dates Calculator
Use this free days between dates calculator to count the exact number of days between any two dates. Enter a start date and end date to get the total day count instantly - including the week breakdown and an approximate years/months/days summary. Leap years are handled automatically.
All calculations use standard published formulas. Results are for informational use only.
First date of the range.
Last date of the range (can be future).
How to use this days between dates calculator
- Enter your start date in the first field. You can use the date picker or type in YYYY-MM-DD format.
- Enter your end date in the second field. Future dates are accepted for countdowns.
- Press Count days.
- The results appear immediately - total days, total weeks, and a years/months/days summary.
- Check the step-by-step section to see exactly how the count was arrived at.
Dates can be entered in any order - the calculator always counts from the earlier date to the later one.
How the day count works
Counting exact days between dates requires a method that correctly handles months of different lengths and leap years. The most reliable approach uses Unix timestamps - converting each date to a count of milliseconds since midnight January 1, 1970, subtracting, and dividing by 86,400,000 (the number of milliseconds in one day).
This one-step arithmetic handles everything automatically. Every February 29 in the range contributes its full 86,400,000 milliseconds to the difference; no extra code is needed to detect leap years. The result is always a whole number because both dates are normalised to midnight before conversion.
Why 86,400,000 milliseconds per day?
One day = 24 hours x 60 minutes x 60 seconds x 1,000 milliseconds = 86,400,000 ms. This value is fixed for all calendar days except on days that cross a daylight saving time transition. Because both dates are set to midnight in the local calendar (not a UTC offset), DST transitions do not affect the count - any clock-shift is applied equally to both endpoints.
The formula
startMs = midnight timestamp of start date
endMs = midnight timestamp of end date
totalDays = abs(endMs - startMs) / 86,400,000
totalWeeks = floor(totalDays / 7)
remainDays = totalDays mod 7What does "days between dates" mean?
The days between dates is the count of calendar days separating two date points. It answers the question: "if I start on date A and finish on date B, how many days is that?" The answer is used across an enormous range of practical contexts.
In finance, simple interest accrues daily. To calculate interest owed on a loan from disbursement to repayment, you need the exact day count. In project management, sprint lengths, milestone gaps, and deadline countdowns all depend on an accurate day count. In law and human resources, probation periods, notice periods, and benefit eligibility periods are defined in calendar days.
The years/months/days breakdown shown alongside the total is an approximate calendar expression of the same number. The two values always represent the same duration - one in raw days, one in human-readable calendar units.
Understanding your result
Total days
The exact count of calendar days between the two dates, exclusive of the end date (the standard mathematical convention). This is the primary result and is precise to the day.
Total weeks and remainder
Total days divided by 7, floored to whole weeks, plus any remaining days. Useful for scheduling recurring weekly events, counting pay periods, and any weekly-cycle planning.
Decimal weeks
The exact week count including fractional weeks. 10 days = 1.43 weeks. Useful for proportional calculations - for example, if a weekly salary needs to be prorated for a partial week.
Years, months, days summary
An approximate calendar breakdown of the same duration. Useful for communicating the span in human-friendly terms - "about 2 years and 7 months" - rather than citing a large day count.
Days between dates examples
Example 1 - Project deadline
Start: March 20, 2026 (today) - End: June 30, 2026
March has 31 days: 11 remaining in March, all of April (30), all of May (31), and 30 days in June = 11 + 30 + 31 + 30 = 102 days (14 weeks, 4 days).
Example 2 - Lease duration confirmation
Start: September 1, 2023 - End: September 1, 2024
This one-year span crosses Feb 29, 2024 (leap year). Total = 366 days (52 weeks, 2 days).
Example 3 - Loan interest period
Start: January 15, 2025 - End: July 15, 2025
Jan: 16 remaining + Feb: 28 + Mar: 31 + Apr: 30 + May: 31 + Jun: 30 + Jul: 15 = 181 days (25 weeks, 6 days). A lender would use 181 as the day count for simple interest calculation.
Quick tips for counting days
- Countdowns: Enter today as start and your target date as end. The result shows exactly how many days remain.
- Including the end date: Add 1 to total days if your use case counts both the first and last day as active days (e.g., a 5-day conference from Monday to Friday).
- Same date: Entering identical start and end dates returns 0 days - no time has elapsed.
- Interest calculations: Many simple-interest formulas use the Actual/365 or Actual/360 day-count convention. Use the total days from this calculator as the numerator and divide by 365 or 360 as your lender specifies.
- Business days: This tool counts all calendar days. To get business days only, subtract the number of weekends (approximately 2 days per week) and any public holidays falling in the range.
Common mistakes when counting days between dates
Multiplying years by 365 without checking for leap years
A three-year span from 2020 to 2023 is 366 + 365 + 365 = 1,096 days, not 1,095 - because 2020 was a leap year. Always use exact arithmetic when day-count precision matters.
Using "30 days per month" approximations
A span from January 1 to April 1 is 90 days (31 + 28 + 31 = 90 in a non-leap year), not 90 (3 x 30). The 30-day approximation introduces errors of up to 3 days per month and compounds over longer periods.
Not specifying the inclusive/exclusive convention
From Monday to Friday is 4 days (exclusive end) if you count Mon/Tue/Wed/Thu, but 5 days (inclusive both ends) if you count Mon/Tue/Wed/Thu/Fri. Always clarify with stakeholders which convention applies before using a day count in a contract or schedule.
Assuming a "month" is always 30 or 31 days
February has 28 or 29 days. Any span that includes the end of February will differ from the same nominal span in other months. For exact day counts, always compute from specific calendar dates rather than adding a fixed number of days per month.
Frequently Asked Questions
How do I calculate days between two dates?
Convert both dates to the number of milliseconds since a fixed reference point (the Unix epoch - January 1, 1970), subtract the earlier from the later, then divide by 86,400,000 (the number of milliseconds in a day). This approach automatically handles months of different lengths and every leap year in the period. This calculator does the work instantly and shows the step-by-step working.
Does the days between dates calculator count leap years?
Yes. Because the calculation uses raw millisecond subtraction, every February 29 that falls within the range is automatically included. A span from January 1, 2020 to January 1, 2024 correctly returns 1,461 days (including the leap day in 2020 and 2024), not 1,460.
Does the calculator count the start date, the end date, or both?
By default this calculator counts from the start date up to but not including the end date - the standard mathematical interval convention. If you need to include both endpoints (for example, an event that runs from Monday through Friday inclusive = 5 days), add 1 to the total days result.
How many days are between two dates that are exactly one year apart?
It depends on whether the span crosses a February 29 in a leap year. Most one-year spans contain 365 days. A span from February 1, 2024 to February 1, 2025 contains 366 days because it includes February 29, 2024 (a leap year). Always use an exact calculation rather than assuming 365 days per year.
What is the difference between days between dates and date difference?
Both tools find the gap between two dates, but they emphasize different outputs. Days between dates focuses on the total day count as the primary result, which is ideal for countdown timers, interest calculations, and deadline tracking. Date difference emphasizes the years/months/days breakdown, which is more readable for age, tenure, or document purposes. Both values are shown here for completeness.
Can I use this to count days until a future date?
Yes. Enter today's date as the start date and your target date as the end date. The result is the exact number of days remaining. This is useful for counting down to an event, a deadline, a birthday, or any scheduled date. The calculator accepts any future date without restrictions.