Calculators

How Many Days Between Two Dates? (Calculator + Manual Method)

Whether calculating project deadlines, rental periods, visa durations, or days until an event, knowing how many days between two dates is an everyday requirement. Calculate exact days between two dates: understand inclusive vs exclusive counting, leap years, working days, and manual calculation formulas.

Awais 2 min readPublished
How Many Days Between Two Dates? (Calculator + Manual Method)

Whether calculating project deadlines, rental periods, visa durations, or days until an event, knowing how many days between two dates is an everyday requirement. While you can count days on a calendar, leap years, varying month lengths (28, 30, or 31 days), and inclusive vs. exclusive counting rules often lead to off-by-one errors.

Our free Date Difference Calculator computes total days, weeks, months, and working days instantly. Here is how date calculation works and how to calculate it manually.

Inclusive vs Exclusive Date Counting

The most frequent source of confusion when counting days is deciding whether to count the start date, the end date, or both:

  • Exclusive counting (Default): Measures the duration or time elapsed between two moments. (Example: Monday morning to Wednesday morning = 2 days).
  • Inclusive counting (Both dates counted): Used in hotel bookings, event passes, and legal notices where day 1 and the final day both count. (Example: August 10 through August 12 = 3 days).
Calculation rule: Inclusive Days = (End Date - Start Date) + 1 day.

How to calculate days between dates in JavaScript

In software development, converting dates to UTC milliseconds avoids daylight saving time discrepancies:

const d1 = new Date("2026-08-10");
const d2 = new Date("2026-09-08");
const diffMs = Math.abs(d2 - d1);
const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24));
console.log(diffDays); // 29 days

Breaking down results into weeks and months

Beyond total day counts, users often need breakdowns:

  • Total days: e.g. 45 days.
  • Weeks + days: 6 weeks and 3 days (45 / 7 = 6 remainder 3).
  • Business days: Excludes Saturdays and Sundays (roughly 5/7th of total days, minus national holidays).

For instant calculations with automatic leap year and timezone handling, use our free Date Difference Calculator or Business Days Calculator.


Frequently asked questions

Subtract the start timestamp from the end timestamp in milliseconds, divide by 86,400,000 (milliseconds in a day), and round down. Alternatively, use ToolOrbit's free Date Difference Calculator for instant results.

Exclusive counting measures the gap between dates (Aug 1 to Aug 3 = 2 days). Inclusive counting counts both boundary dates as active days (Aug 1 to Aug 3 = 3 days). Inclusive = Exclusive + 1.

Leap years add February 29th (making the year 366 days instead of 365). Any date span crossing Feb 29 in a leap year (e.g. 2024, 2028) contains one additional day.

Divide total days by 7: the quotient is whole weeks and the remainder is remaining days (e.g., 25 days = 3 weeks and 4 days).


Tools mentioned

More reading

View all guides
Counting Days Between Dates: Inclusive vs Exclusive
Calculators

Counting Days Between Dates: Inclusive vs Exclusive

Should you count the first day, the last day or both? How inclusive and exclusive day counting differ, plus leap years and business days.

2 min readPublished
How to Calculate Percentages: 3 Formulas with Examples
Calculators

How to Calculate Percentages: 3 Formulas with Examples

The three percentage formulas, worked examples, common mistakes, and the difference between percent and percentage points.

2 min readPublished
What Is BMI? Formula, Categories and Limitations
Calculators

What Is BMI? Formula, Categories and Limitations

How body mass index is calculated, what the categories mean, a worked example, and the limits of BMI as a health measure.

2 min readPublished
How Age Is Calculated in Years, Months and Days
Calculators

How Age Is Calculated in Years, Months and Days

How an exact age is worked out from two dates, why months make it tricky, and how to count down to a birthday.

2 min readPublished
How to Calculate a Tip and Split the Bill
Calculators

How to Calculate a Tip and Split the Bill

The simple maths behind a tip, a worked example for splitting a bill, and a rough guide to tipping customs around the world.

2 min readPublished
How to Calculate a Discount, Stacked Deals and Sales Tax
Calculators

How to Calculate a Discount, Stacked Deals and Sales Tax

How percentage discounts are worked out, why two stacked discounts are less than their sum, and where tax fits in.

2 min readPublished
Unit Conversion Basics: Length, Weight, Temperature and Data
Calculators

Unit Conversion Basics: Length, Weight, Temperature and Data

The conversions worth knowing by heart, why temperature needs a formula and not a single factor, and a quick worked example.

2 min readPublished
How Random Number Generators Work (and What Makes a Draw Fair)
Calculators

How Random Number Generators Work (and What Makes a Draw Fair)

The difference between Math.random and cryptographic randomness, how to draw numbers without repeats, and why random and fair are not the same thing.

3 min readPublished