Illustration of two calendar dates with an arrow between them showing the difference in years, months, and days

Date Difference Calculator

Pick two dates to see the difference between them. Runs entirely in your browser.


ℹ️ How this works
  • The years/months/days breakdown is calendar-aware — it simulates adding whole months from the earlier date, clamping to the last day of a shorter month (e.g. Jan 31 + 1 month lands on Feb 28/29), so it never produces a negative or nonsensical component.
  • Runs entirely client-side — nothing here is ever sent anywhere. The JSON API below is a separate, opt-in endpoint for scripts.
💻 Show API usage example (cURL)
curl -sS "https://devops.majbase.com/date-difference-calculator/api" \
    --data-urlencode 'date1=2024-01-31' \
    --data-urlencode 'date2=2024-03-01'

Returns {"years", "months", "days", "total_days", "total_weeks", "first_is_earlier", "same"}, or {"error": "..."} for an unparseable date.