Use our free tool — no sign-up required.
Date Calculator — Free Online ToolHow to calculate the days between two dates
The most reliable way to count days between two dates is to convert both dates to a common numeric reference point and subtract. The standard modern approach uses Unix timestamps — the number of milliseconds elapsed since midnight on January 1, 1970 (UTC). Every date can be expressed as a Unix timestamp, making subtraction straightforward.
The formula is:
Days = (Timestamp B − Timestamp A) / 86,400,000
There are 86,400 seconds in a day and 86,400,000 milliseconds. Dividing the millisecond difference by 86,400,000 gives the number of days as a decimal. Round down for complete days.
Example: How many days between January 1, 2026 and March 14, 2026?
- January: 31 days
- February 2026 (not a leap year): 28 days
- March 1–14: 14 days
- Total: 31 + 28 + 14 = 73 days
Our Date Calculator handles this automatically — enter any two dates and get the result instantly, including the breakdown in weeks and months.
Handling months and leap years
The Gregorian calendar's months have irregular lengths, which makes manual date arithmetic prone to error:
- 31 days: January, March, May, July, August, October, December
- 30 days: April, June, September, November
- 28 or 29 days: February (28 in common years, 29 in leap years)
A leap year occurs when the year is divisible by 4, with two exceptions: century years (ending in 00) must also be divisible by 400 to qualify. This means:
- 2024: divisible by 4 → leap year (366 days)
- 2100: divisible by 100 but not 400 → not a leap year (365 days)
- 2000: divisible by 400 → leap year (366 days)
The leap year rule matters most when your date range spans a February 29. If your start and end dates straddle a leap day, your count will be off by one day if you use a fixed 365-days-per-year assumption.
Converting days to weeks and months
Once you have a total day count, converting to other units is straightforward:
- Weeks: Divide total days by 7. Example: 73 days ÷ 7 = 10 weeks and 3 days.
- Months (approximate): Divide total days by 30.44 (the average days per month in a year). Example: 73 days ÷ 30.44 ≈ 2.4 months.
- Exact months: Count the full calendar months between the two dates, then add the remaining days. This produces a result like "2 months and 13 days".
Note that "months" as a unit is inherently imprecise because months vary in length. For precision-critical applications such as contracts, use total days rather than months.
Practical uses of date difference calculations
Knowing the exact number of days between dates is useful in many everyday and professional contexts:
- Project planning: Calculate the duration between a project start date and deadline to allocate work and identify milestones.
- Contracts and agreements: Many contracts specify duration in days (e.g., "30-day notice period" or "90-day warranty"). Calculating the exact end date from a start date avoids disputes.
- Payment terms: Net 30, Net 60, or Net 90 payment terms mean payment is due 30, 60, or 90 calendar days after the invoice date. Date calculators confirm the exact due date.
- Travel and events: Count the days until a trip, a concert, a wedding, or any other scheduled event to plan preparation time.
- Health and wellness: Track streaks, habits, or medication courses that run for a specific number of days.
- Legal and administrative: Court deadlines, appeals periods, and statute of limitations calculations all require exact day counts.
Working days vs. calendar days
Calendar days include every day of the week including weekends. Working days (also called business days) exclude Saturdays and Sundays, and often public holidays as well.
To count working days between two dates manually:
- Count the total calendar days between the two dates.
- Subtract the number of complete weeks × 2 (to remove all weekend days).
- Adjust for any partial weeks at the beginning and end of the range.
- Subtract any public holidays that fall within the range (these vary by country and year).
This manual process is tedious and error-prone for ranges longer than a few weeks. Our Date Calculator shows total calendar days between any two dates instantly.
Frequently asked questions
How do I calculate the number of days between two dates?
Subtract the earlier date from the later date. The most reliable method converts both dates to Unix timestamps (milliseconds since January 1, 1970) and divides the difference by 86,400,000 to get days. Our Date Calculator does this instantly for any two dates — just enter both dates and read off the result.
How many days are in a month?
Months have 28, 29, 30, or 31 days depending on the month and whether it is a leap year. January, March, May, July, August, October, and December have 31 days. April, June, September, and November have 30 days. February has 28 days in a common year and 29 days in a leap year.
What is a leap year?
A leap year occurs when the year is divisible by 4, except for century years (divisible by 100), which must also be divisible by 400. So 2000 and 2400 are leap years, but 1900 and 2100 are not. In a leap year, February has 29 days instead of 28, giving the year 366 days instead of 365.
How many working days are between two dates?
To count working days, exclude Saturdays and Sundays from the total calendar day count. Also subtract any public holidays that fall within the range — these vary by country and must be accounted for manually. Our Date Calculator shows total calendar days between any two dates.
Conclusion
Calculating the number of days between two dates requires accounting for irregular month lengths and leap years, but with the right tool it takes only a moment. Whether you need the answer in total days, weeks, or months — and whether you are planning a project, checking a contract, or counting down to an event — our free Date Calculator gives you an exact, instant result for any two dates.
Ready to calculate days between dates? Try our free tool — works instantly in your browser.
Date Calculator — Try it Free