Skip to main content
Time & DatesFree online calculatorPrivate · Runs in your browser

Date Difference Calculator

Calculate the difference between two dates in years, months, weeks, and days. Count calendar days, weekdays, and business days with accurate leap-year handling.

Calendar days: 30View results ↓

How many days are between two dates?

Picker display follows your device locale. ISO text is unambiguous. Supported years: 0001–9999.

Selected ISO date: 2025-01-01

Selected ISO date: 2025-01-31

Reversed entries are sorted first. Exclude-end means the earlier date is included and the later date is excluded.

The starting values are a fixed worked example. Today uses your local calendar date only when clicked. Entries stay in this page’s memory.

Calendar days

30 days

Earlier date included; later date excluded.

Counted calendar days
30
Seven-day groups
4 weeks, 2 days
Decimal counted weeks
4.2857
Calendar endpoint distance
0y 0m 30d
Completed calendar months
0 months + 30 days
Entered start weekday
Wednesday, January 1, 2025
Entered end weekday
Friday, January 31, 2025

Formula

30 elapsed calendar days = 30 counted days

  • Calendar years/months/days describe the endpoint distance and reproduce the later date. Inclusive counting adds one to counted days and week groups, not to that calendar breakdown.
  • Date-only Gregorian arithmetic; these counts do not measure actual elapsed hours across daylight saving changes.

Chronological range

Earlier boundary2025-01-01

Later boundary · excluded2025-01-31

Preview shows the first 14 counted days. Dashed cells mark selected weekend days. Custom holidays are handled in the business-day totals.

Reproduce the calendar breakdown

Start at 2025-01-01. Apply 0 × 12 + 0 = 0 calendar months in one original-date-anchored operation, constrain its day to month end, then add 30 calendar days to reach 2025-01-31.

On this page

What Is a Date Difference Calculator?

A date difference calculator compares arbitrary calendar dates. It can answer how many dates a project covers, how many days remain until an event, or how long ago a date occurred. It does not need a birth date or a time of day.

This tool offers calendar-day differences, business-day counts and date addition or subtraction. It uses the Gregorian calendar consistently, including leap years and real month lengths. It supports years 0001–9999 and identifies reversed date order explicitly.

How to Use the Date Difference Calculator

  1. Select Difference Between Two Dates, Business Days Between Dates, or Add or Subtract Dates.
  2. Choose dates with your device’s picker, or select ISO text and type YYYY-MM-DD. The picker’s visible layout depends on your browser locale; the selected value is shown unambiguously below it.
  3. For an interval, choose whether to exclude the later end date or include both dates.
  4. For business days, optionally customize excluded weekdays and enter holiday dates.
  5. Read the result and its counting convention. Copy, print or export the calculation if needed.

Swap exchanges only the entered dates. Each Today button updates its own input using your local calendar date when clicked. Reset restores the labeled January 1–31, 2025 worked example; it does not pretend that example is today. Entries stay in page memory.

How to Calculate Days Between Two Dates

Elapsed calendar-day difference counts boundaries between dates. January 1 to January 31, 2025 crosses 30 day boundaries. December 31, 2023 to January 1, 2024 crosses one.

The arithmetic uses date-only coordinates rather than a pair of local-midnight instants. That avoids a daylight-saving change turning an ordinary date interval into a fractional number of days.

If entries arrive in reverse order, the main count stays nonnegative and a note identifies the reversal. The export also gives the signed endpoint difference for anyone who needs direction.

Inclusive vs Exclusive Date Counting

The default interval includes the earlier date and excludes the later date. Inclusive counting includes both, adding one to the elapsed day count. These conventions count dates consistently in calendar and business modes.

Endpoint counting examples
IntervalExclude later dateInclude both
Jan 1–Jan 31, 202530 days31 days
Jan 1–Dec 31, 2025364 days365 days
Same calendar date0 days1 day

Including an end date that is a weekend adds a calendar date but may add no business day. The calendar years/months/days breakdown still measures endpoint distance; it does not shift the end date forward.

How to Calculate Weeks Between Dates

Complete weeks = floor(counted days ÷ 7). Remaining days = counted days modulo 7. Decimal weeks = counted days ÷ 7.

For 45 days, that gives six weeks and three days, or about 6.4286 weeks. These are groups of seven counted dates, not calendar-week numbers. Inclusive mode applies the same formulas after adding its extra end date.

How to Calculate Months Between Dates

Calendar months vary from 28 to 31 days, so dividing a day count by 30 does not give a reliable calendar-month difference. This tool counts completed calendar months under a documented month-end convention.

Month shifts keep the original day if possible and otherwise constrain to the last valid destination day. January 31, 2024 plus one calendar month is February 29, 2024. It does not overflow into March. January 31 to February 28 in that leap year is not yet the full constrained month.

For combined offsets, years and months are first combined into one total month shift from the original date. This avoids drifting through a sequence of intermediate month ends.

How to Calculate Years, Months, and Days

The calculator finds completed calendar years first, then additional completed months under the original-date anchor, then remaining calendar days. Years are not assumed to have 365 days.

To reproduce the later endpoint, combine the displayed years and months as years × 12 + months, apply that month offset once to the earlier date with month-end constraining, then add the remaining days. The expandable calculation beneath the result shows these exact steps.

This convention is shared with the site’s calendar utilities. It describes arbitrary date intervals here; use the Age Calculator when your question concerns age from a birth date.

How Leap Years Affect Date Calculations

A Gregorian leap year is divisible by 4, except century years must also be divisible by 400. Thus 2024 and 2000 are leap years, while 2025 and 1900 are not.

February 28 to March 1, 2024 spans two calendar days. February 29 is accepted only in a valid leap year; an invalid date is rejected instead of silently becoming a date in March.

The same Gregorian rules are extended across the supported year range. Historical regional calendar switches are not modeled.

How to Count Business Days

Business mode begins with the selected calendar interval, removes dates whose weekdays are selected as weekends, then removes unique custom holidays that fall on otherwise eligible dates. The default weekend is Saturday and Sunday.

Friday, October 23, 2026 to Monday, October 26, 2026 has three counted calendar days under the default convention: Friday, Saturday and Sunday. Removing Saturday and Sunday leaves one business day. Including Monday adds a second eligible date unless that Monday is entered as a holiday.

Custom weekend patterns are supported. The separate Monday–Friday metric always means those literal weekdays; “eligible before holidays” follows your selected pattern. If no weekdays are excluded, every counted date is eligible before holidays. If all seven are excluded, there are no eligible days.

Enter your own holiday dates in YYYY-MM-DD format, separated by newlines, commas or semicolons. Duplicates are counted once; holidays outside the interval or already excluded as weekends do not reduce the count again. No US, UK, Pakistani or other public-holiday calendar is assumed.

How to Add or Subtract Days from a Date

In Add or Subtract Dates mode, select the starting date, operation and a nonnegative whole number of days. January 1, 2025 plus 30 days gives January 31, 2025. March 1, 2024 minus one day gives February 29, 2024.

Optional years, months and weeks support calendar-aware adjustments. Years and months combine into one signed month offset, constrained at the destination; weeks × 7 and days are applied afterward. These are calendar days, not business days.

A zero offset returns the starting date. Results outside years 0001–9999 are rejected. Month-end constraining is not always reversible, so reversing an operation can produce a different day near a month boundary.

Date Difference vs Time Duration

Calendar-date difference counts date boundaries. Actual elapsed hours compare instants and require timezone rules; local clock changes can make a calendar day shorter or longer than 24 elapsed hours.

This tool has no time-of-day or zoned elapsed-time mode. The existing Time Duration Calculator handles hour/minute wall-clock intervals and documents its own timezone limitations. Date-only counts here remain stable across the viewer’s timezone.

Frequently Asked Questions

How many days are between two dates?

It depends on the endpoints and counting convention. January 1 to January 31, 2025 has 30 elapsed calendar days. Including both dates counts 31 dates.

How do I calculate the difference between dates?

Compare their Gregorian calendar-day positions. The difference counts day boundaries without using local-midnight timestamps. This calculator also provides seven-day groups and an original-date-anchored calendar breakdown.

Does the calculator include the start date?

By default it counts the earlier date and excludes the later date. A same-day interval is therefore empty. Reversed entries are sorted chronologically and marked; the earlier boundary is counted even when it was entered as End date.

What does inclusive date counting mean?

It includes both chronological endpoints. The inclusive count is the nonnegative elapsed day difference plus one, so a same-day inclusive interval contains one date.

How many weeks are in 45 days?

45 ÷ 7 gives six complete seven-day groups and three remaining days, or approximately 6.4286 weeks. These groups are not named calendar weeks such as ISO week numbers.

How do I calculate months between two dates?

Use calendar months of their actual lengths. This tool anchors shifts to the original day, constrains to the destination month end if necessary, then counts remaining days. It does not divide days by 30.

Does leap year affect date differences?

Yes. February 28 to March 1, 2024 spans two days because February has 29 days. The same interval in 2025 spans one day. Century years are leap years only when divisible by 400.

How do I count weekdays only?

Select Business Days Between Dates and leave Saturday and Sunday excluded. The result shows eligible weekdays, weekend exclusions and business days after any custom holiday exclusions. You can change the excluded weekday set.

How do I exclude public holidays?

Enable custom holiday dates and enter the dates your schedule observes, in YYYY-MM-DD format. No national holiday calendar is assumed. Duplicate dates, holidays outside the interval and holidays already excluded as weekends are not subtracted again.

Can I calculate a date 90 days from today?

Yes. Choose Add or Subtract Dates, click Today for the starting date, choose Add and enter 90 days. Today uses your device’s local calendar date only when clicked.

Why can calendar days and elapsed hours differ?

A local day can have a different number of clock hours during a daylight-saving change. Calendar-day differences count dates, while actual elapsed time requires timestamps and timezone rules. This page does not calculate zoned elapsed hours.

Why does the calendar breakdown stay the same when I include both dates?

The breakdown describes how to reach the later endpoint from the earlier one. Including both dates adds an extra counted date, not an extra endpoint step. Counted days and seven-day groups change; the endpoint breakdown remains reproducible.

Does adding then subtracting a calendar month always undo itself?

No. January 31, 2024 plus one month constrains to February 29. Subtracting one month from February 29 gives January 29. Month-end constraining can lose the original day, so the reverse operation need not restore it.

Calendar Method & Sources

Proleptic Gregorian calendar, years 0001–9999. Default interval includes the earlier date and excludes the later date; inclusive counting includes both. Reversed entries are sorted chronologically and flagged. Calendar breakdown always describes the unextended endpoint distance. Years and months combine into one original-date-anchored month shift, constrained to the destination month’s last valid day, followed by remaining days. Date-only arithmetic does not measure elapsed hours.

Business counting uses complete weeks plus at most six remainder days, so even long ranges do not require visiting millions of dates. Custom holiday input is limited to 500 entries. The short range strip previews at most fourteen counted dates; textual results describe the full interval.

The implementation uses the site’s tested calendar utilities without depending on browser support for Temporal. There are no external date calculation or holiday requests.