Back to Blog
Calculator Guides5 min readNovember 21, 2025The Toolbox Team

How to Calculate the Number of Days Between Two Dates

Learn how to count the days between two dates in seconds, plus the manual method, business days, and how to include the end date correctly.

Counting the days between two dates without the headache

Working out how many days sit between two dates sounds easy until you actually try it. Months have different lengths, leap years sneak in an extra day, and it is genuinely hard to remember whether you should count the last day or not. Whether you are figuring out how long until a deadline, how many days a project ran, or how much notice a contract requires, doing it by hand invites off-by-one mistakes.

This guide shows the fast way using a free calculator, plus the manual method so you understand what is happening and can sanity-check the result. It also covers the common gotcha: deciding whether the end date counts.

How to calculate the days between two dates

The quickest route is the date difference calculator, which runs entirely in your browser. The dates you type stay on your device, nothing is uploaded, and there is no sign-up.

  1. Open the Date Difference tool. It loads on the "Date Diff" tab by default, with a Start Date and End Date already filled in so you can see how it works.
  2. Set the Start Date. Click the start field and pick your earlier date, or hit the "Today" button next to it to jump to the current date.
  3. Set the End Date. Pick the later date the same way. The tool does not mind which one is bigger — if you reverse them it still gives the correct count and just flags the result as "in the past" instead of "in the future."
  4. Read the total days. The result appears instantly. The headline shows the gap in years, months, and days, and the breakdown grid below shows Total Days, total weeks, hours, minutes, and seconds. The number you usually want is the "Total Days" box.
  5. Decide whether to count the end date. Tick the Include end date checkbox if both the first and last day should count (more on this below). The totals update the moment you toggle it.
  6. Copy or export the result. Use the Copy button to grab a clean text summary, or CSV to download a spreadsheet-ready file with every metric. The tool also keeps a short local history of recent calculations in case you need to compare.

That is the whole flow. If you only need a single number, you will have it within a couple of clicks.

The manual method (and the formula)

The underlying math is simple once dates are turned into a single running count. Computers store a date as the number of days (or milliseconds) since a fixed reference point, then subtract:

Days between = (later date as a number) − (earlier date as a number)

By hand, the reliable approach is to count to the end of the start month, add the full months in between, then add the days into the final month — adjusting for any February 29 that falls inside the range. For example, from March 10 to April 2: 21 days left in March (March has 31 days) plus 2 days in April equals 23 days. The calculator does exactly this, which is why it never trips over month lengths or leap years.

Counting business days instead

If weekends and holidays should not count, switch to the Business Days tab. There you can choose which weekdays count as working days (Mon–Fri by default), toggle US federal holidays, and add your own custom holiday dates. The tool then reports working days, weekend days, and holidays separately for the same range.

Common problems

  • Off-by-one results. This almost always comes down to the Include end date setting. Leaving it unchecked counts the gap between the dates (June 1 to June 2 = 1 day). Checking it counts both endpoints as full days (June 1 to June 2 = 2 days). Pick whichever matches how you are framing the question — duration of a stay usually wants it on, "days until" usually wants it off.
  • The number looks too big or too small by one. Leap years are the usual culprit when checking by hand. If your range crosses a February 29, the calculator already accounts for it and even lists which leap years fall inside the range.
  • Time zones shifting the count. If you are comparing exact moments rather than calendar dates, a few hours can push a result across midnight. For plain calendar dates this does not apply, but if you are working from Unix timestamps, convert them first with the epoch to date converter so you are comparing real dates.

FAQ

Does the calculator count the start and end day, or just one of them? By default it counts the gap between them, so it includes neither endpoint as an "extra" day — March 1 to March 2 returns 1 day. Tick Include end date to count both calendar days, which returns 2 days for the same range.

How are leap years handled? Automatically. Because the tool works from the actual calendar, any February 29 inside your range is counted, and it even shows you which leap years occur between your two dates.

Can I work out a future date instead of a gap? Yes. Use the Add/Subtract tab to add or subtract days, weeks, months, or years from a starting date — handy for finding a deadline 90 days out. For working out someone's exact age in years, months, and days, the dedicated age calculator is more focused.

Is anything saved or uploaded? No. The calculation happens in your browser, so the dates you enter stay on your device. The only thing stored is an optional recent-calculation history kept locally for your own convenience.

Need a related tool? Try the duration calculator for adding up spans of time, or the age calculator when you need an exact age down to the day.