calculators.dev

Days Between Dates

Find the exact number of days between any two calendar dates — useful for working out a rental or loan term, the length of a trip or project, a notice or warranty period, or simply how long ago something happened. The calculator counts whole calendar days and also breaks the total into weeks and leftover days, so a long span is easy to read at a glance. An inclusive/exclusive toggle lets you choose whether both the start and end date are counted, which is the detail that trips most people up when a contract or billing period hangs on it.

Calculate

Default result: 180 days

Off counts the difference (nights). On counts both endpoints, adding one day.

Days Between Dates · Result

calculators.dev

Days between

180days

2026-01-01 × 2026-06-30

Weeks
25wk
Remaining days
5days
Days between180days

Embed this calculator on your site

Free, no sign-up — it links back to calculators.dev.

Reviewed by the calculators.dev team · Last updated 2026-06-25

How to calculate

Pick a start date and an end date — the order does not matter, since the calculator always reports the gap as a positive number of days. By default it returns the exclusive difference: the number of nights or full days from one date to the other, so January 1 to January 2 is one day. Switch on the inclusive toggle to count both endpoints instead, which adds one to the total and answers questions like 'how many days does this event run, counting the first and last day'. The weeks-and-days breakdown then divides the total by seven, so 180 days reads as 25 weeks and 5 days.

days = |endDay - startDay|; inclusive adds 1. Day counts use UTC calendar days, so the result is unaffected by daylight saving time.
Example calculation

From January 1, 2026 to June 30, 2026 is 180 days (exclusive), which is 25 weeks and 5 days.

totalDays
180 days
breakdown
25 weeks and 5 days

Assumptions

  • By default the count is exclusive (the standard date difference, e.g. Jan 1 to Jan 2 is 1 day). Turn on the inclusive toggle to count both endpoints, which adds one to the total.
  • Dates are counted as whole UTC calendar days, so daylight saving transitions never shift the result by an hour and a span that crosses a time change still comes out as a whole number.
  • Leap days are handled automatically: any February 29 inside the span is counted as a real day, so a year that contains one is 366 days rather than 365.

Common mistakes

  • Expecting an inclusive count by default — the default is the standard exclusive difference, so for an event that runs 'both days inclusive' you need to turn the toggle on.
  • Reading the weeks-and-days breakdown as a decimal: 25 weeks and 5 days is not 25.5 weeks. The remainder is the leftover days after taking out whole weeks, not a fraction.
  • Assuming a year is always 365 days when subtracting dates by hand — a span crossing February 29 has an extra day, which is exactly the kind of off-by-one this calculator removes.

Frequently asked questions

Does the count include both the start and end date?

By default no — the result is the difference between the two dates, the same as counting nights between them. Turn on the inclusive toggle to count both endpoints, which adds one day to the total.

Why is the result the same across daylight saving changes?

The calculator counts whole UTC calendar days rather than subtracting timestamps, so a clock change never adds or removes an hour from the result. A span that crosses a spring-forward or fall-back boundary still comes out as a clean whole number of days.

Does it count leap days?

Yes. Any February 29 that falls inside the span is counted as an ordinary day, so a range covering a leap year is 366 days rather than 365. You never have to adjust for leap years yourself.

Does the order of the two dates matter?

No. The calculator reports the gap as a positive number however you enter the dates, so putting the later date first gives the same answer as putting the earlier one first.