Skip to main content

Free Date Difference Calculator

Calculate the exact difference between two dates — years, months, days, weeks, working days (excluding weekends), hours, and minutes.

Works offline once loaded

Quick presets

Select both dates to see the difference.

Common uses

  • Calculate Days Until Due DateCount down to the baby's due date — find out exactly how many weeks, days, and hours until the big day.
  • Days Until Your VacationCount down to your trip with working days, total days, and weeks remaining for planning purposes.
  • Working Days to Project DeadlineCalculate the exact number of working days (excluding weekends) between today and a project deadline.
  • Calculate Anniversary Days TogetherFind out exactly how many days, months, and years you've been together with someone special.
  • Age Gap Calculator Between Two PeopleCalculate the exact age difference between two birthdays — years, months, and days apart.

How It Works

All calculation runs entirely in the browser using hand-written UTC arithmetic — no external library, no server request. The tool parses YYYY-MM-DD strings into calendar components, computes differences using Date.UTC() millisecond timestamps to avoid DST drift, and iterates day-by-day to count Monday–Friday working days.

  1. 1
    Safe date parsing
    Each date string is validated with a regex and then reconstructed via Date.UTC() — not new Date(string) — so that users west of UTC never see a weekday shift caused by the browser's local-timezone interpretation of date-only inputs.
  2. 2
    UTC millisecond subtraction
    The two calendar dates are converted to UTC midnight timestamps with Date.UTC(y, m, d). Integer division by 86,400,000 ms gives an exact whole-day count that is immune to daylight-saving transitions, which can otherwise make a day appear 23 or 25 hours long.
  3. 3
    Calendar breakdown and working-day count
    A hand-written year/month/day decomposition handles month-length irregularities (borrowing days from the preceding month when needed). A separate loop steps through every UTC day between the two dates and increments a counter only for Monday–Friday (getUTCDay() !== 0 or 6), producing an exact working-day total regardless of locale.
  4. 4
    Results displayed in all units
    The totals are formatted with toLocaleString() using the page locale for locale-aware digit grouping, then shown simultaneously as years/months/days, total days, working days, weeks, hours, and minutes. The current date pair is written into the URL via history.replaceState so any result can be bookmarked or shared as a direct link.

Related Tools

Frequently Asked Questions