Use our free tool — no sign-up required.

Date Calculator — Free Online Tool

How 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?

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:

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:

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:

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:

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:

  1. Count the total calendar days between the two dates.
  2. Subtract the number of complete weeks × 2 (to remove all weekend days).
  3. Adjust for any partial weeks at the beginning and end of the range.
  4. 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

Related tools