Free Date Difference Calculator
Calculate the exact difference between two dates — years, months, days, weeks, working days (excluding weekends), hours, and minutes.
Quick presets
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.
- 1Safe date parsingEach 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.
- 2UTC millisecond subtractionThe 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.
- 3Calendar breakdown and working-day countA 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.
- 4Results displayed in all unitsThe 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
Working Days Calculator
Count business days between dates or add/subtract business days from a date. Configurable weekend handling and holiday list.
Touch Screen Test
Paint with your fingers to find dead zones on your touch screen, count how many touches it registers at once, and see pressure and contact size.
Time Calculator
Add or subtract HH:MM:SS durations, or find the time between two timestamps. Useful for work logs, race splits, and project tracking.