Xerobit

Days Between Dates Calculator

Enter a start date and an end date to find the exact number of days between them. This days between dates calculator also breaks the span into weeks, calendar months, business days and weekends. It runs entirely in your browser using UTC arithmetic so daylight saving changes never affect the result.

Result

  • Total days
    364
  • Weeks and days
    52 weeks, 0 days
  • Months and days
    11 months, 30 days
  • Years, months, days
    0 years, 11 months, 30 days
  • Business days (Mon-Fri)
    260
  • Weekends (Sat-Sun days)
    104

How to use the days between dates calculator

  1. Enter the start date in YYYY-MM-DD format.
  2. Enter the end date in YYYY-MM-DD format.
  3. Choose whether to include or exclude the end day from the count.
  4. Read the total days, weeks, calendar breakdown, business days and weekend days instantly.

How the date math works

The calculator parses each date string into year, month and day components, then converts them to a UTC millisecond timestamp using Date.UTC(year, month - 1, day). Working in UTC avoids any shift caused by local daylight saving time transitions.

The difference in milliseconds is divided by 86,400,000 (the number of milliseconds in one day) to get the raw day count. If you choose to include the end day, exactly one is added. For example, from 2026-01-01 to 2026-01-02 exclusive gives (Jan 2 - Jan 1) / 86400000 = 1 day. Inclusive gives 2 days.

To compute the calendar breakdown (years, months, days), the tool subtracts the end day from the start day. If the result is negative, it borrows one calendar month from the end date and adds that month's exact length to the day count. Then it subtracts months, borrowing a year if needed. This guarantees the same result regardless of which months are involved.

Common date spans reference

This table shows the number of days between two dates for frequently used spans in 2026, calculated with the end day excluded.

SpanStartEndDays
January2026-01-012026-02-0131
February (non-leap)2026-02-012026-03-0128
Q12026-01-012026-04-0190
First half2026-01-012026-07-01181
Full year2026-01-012027-01-01365

Business days and weekends

When planning projects or calculating notice periods, knowing just the total number of days between dates is rarely enough. You usually need the count of weekdays (Monday through Friday) separate from weekend days (Saturday and Sunday).

This days between dates calculator iterates through every day in the range and checks its day of the week. A day is counted as a business day if its UTC weekday index is 1 through 5. Weekend days have an index of 0 (Sunday) or 6 (Saturday). Business days plus weekend days always equals the Total days figure, whichever end-day option you choose.

If you need to add a specific number of working days to a starting point rather than measure a gap, use the add days to date tool instead.

Inclusive versus exclusive counting

A common source of errors when finding the days between two dates is mixing up inclusive and exclusive counting. Exclusive counting measures the gap: the number of midnights crossed. From Monday to Tuesday exclusive is 1 day. Inclusive counting includes both the start and the end date as full days. From Monday to Tuesday inclusive is 2 days.

Hotel bookings typically use exclusive counting because you pay for the nights stayed. Event planning and leave requests often use inclusive counting because both the first and last day count as part of the activity. Select the option that matches your use case to avoid off-by-one mistakes.

Worked examples

ExampleInputResult
Full year 2026Start date: 2026-01-01; End date: 2026-12-31; End day: excludeTotal days: 364; Weeks and days: 52 weeks, 0 days; Months and days: 11 months, 30 days; Years, months, days: 0 years, 11 months, 30 days; Business days (Mon-Fri): 260; Weekends (Sat-Sun days): 104
Leap year 2024Start date: 2024-01-01; End date: 2024-12-31; End day: excludeTotal days: 365; Weeks and days: 52 weeks, 1 days; Months and days: 11 months, 30 days; Years, months, days: 0 years, 11 months, 30 days; Business days (Mon-Fri): 261; Weekends (Sat-Sun days): 104
One work weekStart date: 2026-03-02; End date: 2026-03-06; End day: includeTotal days: 5; Weeks and days: 0 weeks, 5 days; Months and days: 0 months, 4 days; Years, months, days: 0 years, 0 months, 4 days; Business days (Mon-Fri): 5; Weekends (Sat-Sun days): 0
Same day includedStart date: 2026-06-15; End date: 2026-06-15; End day: includeTotal days: 1; Weeks and days: 0 weeks, 1 days; Months and days: 0 months, 0 days; Years, months, days: 0 years, 0 months, 0 days; Business days (Mon-Fri): 1; Weekends (Sat-Sun days): 0

FAQ

How do I calculate the number of days between two dates?

Enter both dates in YYYY-MM-DD format into this days between dates calculator. It uses UTC timestamps to subtract the start from the end, divides by 86,400,000 milliseconds per day, and adjusts based on whether you include the end date.

What is the difference between inclusive and exclusive counting?

Exclusive counting measures the gap between the dates without counting the final day. Inclusive counting adds one extra day so both the start and end dates are fully counted.

Does this account for leap years?

Yes. Because the calculation relies on exact UTC timestamps, February 29 in a leap year is automatically included. The span from 2024-01-01 to 2025-01-01 correctly returns 366 days.

How are business days counted?

The tool checks every day in the range. Days falling on Monday through Friday are counted as business days, while Saturdays and Sundays are counted as weekend days. Public holidays are not excluded.

Can the end date be before the start date?

No. This calculator requires the end date to be equal to or later than the start date. If you need to handle reversed ranges, swap the dates manually before entering them.

Is my data sent to a server?

No. All date parsing and arithmetic happen locally in your browser. Nothing is uploaded anywhere.

Why does the months and days breakdown differ from simply dividing by 30?

Dividing total days by 30 ignores the fact that calendar months vary from 28 to 31 days. This tool counts whole calendar months and then the exact leftover days, giving a precise year, month and day breakdown.