Tools Guides
calculators Free No signup

Date Calculator

Calculate the difference between two dates or add/subtract days, weeks, months, and years from any date.

Loading tool…

About this tool

Two tools in one: calculate the exact duration between two dates (years, months, weeks, days), or add and subtract time from any date to find a future or past date. Handles leap years, DST, and month-length variations correctly.

How to use

  1. 1 Select the 'Difference' tab to find how many days/months/years are between two dates.
  2. 2 Or use the 'Add/Subtract' tab to find a date that is N days from a starting date.
  3. 3 Enter your dates using the date picker.
  4. 4 See the result broken down into years, months, weeks, and days.

Why date arithmetic is harder than it looks

Subtracting two dates seems like it should be simple subtraction, but calendars are irregular. Months have 28, 29, 30, or 31 days; leap years insert a February 29; and "one month from January 31" has no obvious answer. Naively counting in fixed 30-day chunks gives wrong results that drift further apart the longer the span. This calculator avoids that trap by using your browser's real calendar engine — the JavaScript Date object — so leap years and varying month lengths are handled correctly. It offers two modes in one: Date Difference, which measures the gap between two dates, and Add / Subtract, which shifts a date forward or backward by a span you specify.

How the difference is calculated

For the total figures — days, weeks, and hours — the tool converts both dates to a millisecond timestamp and subtracts, then divides (86,400,000 milliseconds per day, 3,600,000 per hour). Weeks are the whole number of seven-day blocks in that day count. The years-months-days breakdown uses a different, more intuitive method: it counts whole years and months from the start date by stepping the calendar forward, then measures the leftover days. This is the same way a person counts an age — "you are 34 years, 2 months, and 5 days old" — rather than dividing a raw day count by an average month length. Because the breakdown anchors to the actual start date, the leftover-days figure correctly reflects how many days that final partial month contains.

A worked example

Set the start to January 15, 2024 and the end to March 10, 2024. The total comes to 55 days (note 2024 is a leap year, so February has 29 days: 16 remaining days in January + 29 + 10 = 55), which is 7 whole weeks plus a remainder, and 1,320 hours. The years-months-days breakdown reads 1 month and 24 days: stepping from January 15 forward one month lands on February 15, and from there to March 10 is 24 days. Switch the start to a non-leap year and the same January-to-March span shrinks by a day, because February is shorter — exactly the kind of detail a fixed-30-day calculation gets wrong.

Adding and subtracting dates

In Add/Subtract mode you pick a starting date, choose Add or Subtract, and enter any combination of years, months, weeks, and days. The tool applies them in order: first it shifts the year, then the month, then the weeks and days (weeks are simply multiplied by seven and folded into days). The order matters at month boundaries. Because months are adjusted before days, adding "1 month" to January 31 rolls through the calendar — JavaScript normalizes February 31 into early March — so be aware that month math near the end of a month can land a few days later than you might expect. For day-precise results across month ends, expressing the span in days avoids the ambiguity entirely.

Genuine use cases

  • Deadlines and due dates. Find the date 90 days from today for a contract, return window, or notice period without flipping through a calendar.
  • Age in exact units. Put a birth date as the start and today as the end to read someone's age in years, months, and days — or in total days for a "10,000 days alive" milestone.
  • Project timelines. Measure how many weeks separate a kickoff from a launch, or push a milestone out by a number of weeks.
  • Anniversaries and countdowns. Count down to a wedding, exam, or release, or count up from a past event.
  • Gestation, subscriptions, and warranties. Add a fixed period to a start date to find an estimated end date.

Common mistakes and limits

  • Expecting business days. This tool counts every calendar day. To get working days you must subtract weekends and public holidays yourself, which vary by country and region.
  • Confusing "months" with "30 days." The difference shown in months is calendar months, not 30-day intervals, so two spans with the same day count can show different month figures depending on which months they cross.
  • Month-end edge cases when adding. Because the year and month are shifted before days, adding months to the 29th, 30th, or 31st can overflow into the next month. Use days for exact arithmetic across those boundaries.
  • Time zones and time of day. The calculator works in whole calendar days at local midnight; it does not account for the hours within a day or for crossing time zones, so use a dedicated time-zone tool for clock-level precision.

Everything is computed locally in your browser — the dates you enter never leave your device.

Frequently Asked Questions

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}