Skip to the calculator
SwiftSums
Date & time

Date Difference Calculator. The gap between two days.

Two dates in — the days, weeks, months and years between them out, both as a calendar breakdown and a flat day count.

Live calculation

How far apart?

Order doesn't matter — the earlier date is worked out for you.

Total difference —
Total days
—
Total weeks
—
Direction
—

Your figures are kept on this device only.

How it works

The calculator finds the earlier and later of your two dates, then works out the difference two ways: a calendar breakdown (years, months, remaining days, the way you'd naturally describe an age or a gap) and a flat day count, which is more useful for anything involving pay, interest, or scheduling.

years/months/days = calendar difference between the earlier and later date
total days = round((later date − earlier date) ÷ 1 day)

The two answers are not in competition. They answer different questions. The flat day count is the one to use whenever days are the unit that matters: interest accrued, leave taken, notice given, a shipping window. The calendar breakdown is the one to use when a person is going to read it, because “3 years, 2 months” means something to a reader in a way that “1,171 days” does not.

The calendar breakdown works the way you subtract on paper. Take the years, then the months, then the days. If the later date's day of the month is smaller than the earlier one's, borrow a month, exactly as you would borrow a ten in column subtraction. The size of what you borrow is the length of the month you borrow from, which is why the same gap in days can produce a different months-and-days breakdown depending on where in the year it falls.

Worked example

From 3 March 2023 to 17 May 2026.

Step by step
  1. Years: 2026 − 2023 = 3 years, and May comes after March so no borrowing is needed.
  2. Months: May (5) − March (3) = 2 months.
  3. Days: 17 − 3 = 14 days.
  4. Total flat days between the two dates: 1,171 days.

The gap is 3 years, 2 months, 14 days, or 1,171 days total.

A shorter one, across a leap day

From 1 January 2024 to 1 March 2024.

  1. January has 31 days.
  2. 2024 is a leap year, so February has 29, not 28.
  3. Add them: 31 + 29.

That is 60 days, where the same two dates in 2023 give 59.

Counting inclusively or exclusively

This is the question that causes the most arguments, and it is worth being explicit about because both answers are defensible.

Monday 1 September 2025 to Friday 5 September 2025. How many days is that? The difference is 4 days. That is what you get by subtracting one date from the other, and it is what this calculator reports. But if someone asks how many days you were there, the answer is 5, because Monday and Friday were both days you were there.

Neither is wrong. They are counting different things: one counts the gaps between the days, the other counts the days themselves.

If you are countingUseMon 1st to Fri 5th
Nights in a hotelThe difference4
Days of leave takenThe difference, plus 15
Interest-bearing daysThe difference4
Days of a festival or eventThe difference, plus 15
Notice period servedCheck the contract; both are used4 or 5

The rule of thumb: if both end dates “count” as part of the thing, add one to the difference. If you are measuring the span between them, do not.

Why “one month later” has no single answer

Days are a fixed unit. Months are not, and that creates a genuine ambiguity that no calculator can resolve for you. It can only be honest about it.

What date is one month after 31 January? There is no 31 February, so something has to give. Different systems answer differently: some clamp to the last valid day and say 28 February (or 29 in a leap year), some overflow into 3 March, and some refuse the question. Payment terms, subscription renewals and legal notice periods have all been argued over exactly this.

The same applies to the reverse. A gap of “one month” is 28, 29, 30 or 31 days depending entirely on which month, and “six months” is anywhere from 181 to 184 days.

This is why the flat day count sits alongside the calendar breakdown rather than underneath it. When the exact number matters, and especially when money or a deadline depends on it, use days. They are the only unit here that means the same thing every time.

Common questions

Why does the calendar breakdown sometimes look different from dividing the day count by 30 or 365?

Months don't all have the same number of days and years aren't an exact multiple of days, so a calendar-accurate breakdown (like the one this calculator gives) will differ slightly from a rough division. The flat day-count stat is exact either way.

Does it matter which date I put first?

No. The calculator automatically works out which of your two dates is earlier, so the result is the same either way. The "Direction" stat tells you which one came first.

Does the result include both the start and end dates?

No. The day count is the difference between the two dates, so Monday the 1st to Friday the 5th gives 4. If you need to count both end dates, such as days of leave or days of an event, add one to get 5.

Does it handle leap years?

Yes. Any 29 February falling between your two dates is counted, which is why 1 January to 1 March is 60 days in 2024 and 59 days in 2023.

How many days is "one month"?

Between 28 and 31, depending on the month, and there is no single correct answer. When the exact number matters, such as interest, deadlines or notice periods, use the flat day count rather than the months figure.

Does this count weekends and public holidays?

Yes, every calendar day is counted. If you need working days only, use the business days calculator instead.