Date Difference Calculator
Find the exact number of days, weeks, months and years between any two dates. Handles leap years, includes start-date toggle and instant swap.
| Unit | Value | Unit | Value |
|---|---|---|---|
| Total Days | 92 days | Total Months | 3 months |
| Total Weeks | 13 weeks + 1 day | Years + Months + Days | 0y 3m 0d |
Two dates on a calendar look simple — but calculating the exact gap between them hides real complexity. February has 28 or 29 days. Some month spans cross a year boundary. The question of whether to count the start date affects results by one day in ways that matter legally. This Date Difference Calculator handles all of it: enter any two dates and instantly get total days, weeks, months, and the complete years + months + days breakdown. For working-day counts that skip weekends, jump to the Business Days Calculator.
The Include Start Date Toggle — When It Actually Matters
This single checkbox has surprisingly large real-world implications. A hotel stay from Monday to Friday is 4 nights but 5 days if both check-in and check-out are counted. An employment contract “from 1st January to 31st March inclusive” covers 90 or 91 days depending on the year — and the word “inclusive” means the toggle should be on. Courts in India calculate statutory time limits using both conventions depending on the Act. When in doubt, check your specific agreement's wording: “from and including” means the toggle on; “after” or “from” without “including” usually means off.
How the Math Works Under the Hood
Total days uses millisecond subtraction: Math.round((end − start) / 86400000). This is exact because both dates are normalised to midnight and JavaScript's Date object accounts for DST automatically. The month/year decomposition uses a borrowing algorithm — if the end day is before the start day, one month is subtracted and the previous month's day count (fetched via new Date(y, m, 0).getDate()) is added to the day difference. This is the same logic used by court systems, HR platforms, and actuarial software for date arithmetic.
Real Situations Where This Saves Mistakes
- Notice period verification: Confirm that a resignation or termination letter provides the contractually required number of days without error.
- Loan interest calculation: Banks charge per-day interest on overdrafts and short-term loans. Exact days outstanding determines the interest charge.
- Fixed-term contract auditing: Verify that a 6-month or 12-month contract runs for exactly the stated duration — month counts alone are ambiguous.
- Construction project milestones: Check whether a delivery date falls within or outside a contracted calendar-day window.
- GST invoice dating: E-way bill validity is measured in calendar days from generation — calculate the exact expiry date.
- Travel visa duration: Tourist visas often specify a maximum stay in days. Calculate your permitted departure date from your entry stamp date.
Calendar Days vs Working Days — Choosing the Right Tool
This calculator counts every calendar day — weekends included. That is correct for contracts, loan interest, visa stays, and any duration where every day counts equally. When a contract says “working days” or “business days,” use the Business Days Calculator instead — it excludes Saturdays, Sundays, and any custom holidays you specify. For age from a birth date, the Age Calculator gives the years + months + days result purpose-built for that use case.
Leap Year Accuracy
Leap years are handled automatically by JavaScript's native Date object, which applies the correct Gregorian rules: divisible by 4, except century years must be divisible by 400. February 2000 had 29 days; February 1900 had 28; February 2100 will have 28. A date span crossing February of any year will reflect the exact day count. You never need to add or subtract manually for leap year correction.
Privacy
The Date Difference Calculator runs entirely client-side. The dates you enter are never sent to any server. This makes it safe for sensitive timeline calculations: contract dates, medical appointment intervals, legal filing windows, and tenancy durations that you may not want logged anywhere.
✓Verified by ToollyX Team · Last updated June 2026