Days Between Dates Calculator

Calculate the exact number of days, weeks and remaining days between two dates — instantly, in your browser.

  • Free — No signup required
  • Instant — Results update as you type
  • Private — Processed in your browser

How many days is it from one date to another? The question sounds trivial until you try it by hand across a month boundary, a leap year, or both. The calculator above takes two dates and gives you the interval in days, and in weeks plus leftover days.

How it works

Enter a start date and an end date. The end date defaults to today, so the common case — "how long ago was that?" — is one click. The tool reports:

  • Days — the number of days in the interval.
  • Weeks and days — the same figure expressed as whole weeks with a remainder, which is usually easier to hold in your head. 45 days is 6 weeks and 3 days.

The result is order-independent: swapping the two dates gives the same positive number rather than a negative one.

This is an interval, measured between the two midnights, so the endpoints are not both counted. From the 1st to the 8th is 7 days. If you need the inclusive count — "how many days does this cover, including both the first and the last?" — add one. The distinction matters for hotel nights versus days of a conference, and for notice periods, where the wording of the contract decides which one applies.

Why the arithmetic is fiddly

Dates are parsed as local midnight rather than UTC. Parsing 2026-03-15 as a UTC instant and then reading it back in a local time zone west of Greenwich yields the 14th, and a whole class of "the date is one day out" bugs comes from exactly that. Keeping both ends in the same local frame removes it.

Daylight saving is the other trap. A day is not always 86,400 seconds: twice a year one is 23 hours long and one is 25. Dividing a raw millisecond difference by 86,400,000 therefore drifts by a fraction of a day across a transition, which is why the result here is rounded to the nearest whole day — that rounding is what makes a DST-crossing interval come out right rather than off by one.

Leap years are handled by the underlying calendar, not by a rule of thumb. The rule itself is worth knowing: every year divisible by 4 is a leap year, except centuries, except centuries divisible by 400. 2000 was a leap year; 1900 and 2100 are not.

Doing this in code

Do not write the subtraction yourself. Every mainstream platform has a date-only type that handles month lengths, leap years and DST for you — LocalDate and ChronoUnit.DAYS.between(...) in Java, date in Python, DATEDIFF in SQL. Optional and the date-time API covers the distinction between a LocalDate, a LocalDateTime and an Instant, and why picking the wrong one is the root cause of most date bugs.

Storage is the other half of the problem. A timestamp column without a time zone, populated from application servers in two regions, is unrecoverably ambiguous; a date-only column compared against a timestamp forces an implicit cast that quietly disables the index. SQL best practices covers choosing temporal types and writing range predicates that the planner can actually use.

For a countdown to a future date, the days until date tool phrases the same calculation as "days remaining". To exclude Saturdays and Sundays, use business days — bear in mind it counts both endpoints, so over an identical range it reports one more total day than this tool. To turn a date into its ISO week label, use week number.

FAQ

Does the order of the two dates matter?
No. The calculator always returns the absolute number of days between the two dates, regardless of which one you enter first.
Does this account for leap years?
Yes. The calculation uses real calendar dates, so leap years are handled automatically.
Is the start or end date included in the count?
The result is the number of full days between the two dates — for example, January 1 to January 2 is 1 day, not 2.