Business Days Between Dates Calculator
Calculate the number of business days between two dates.
Enter your values and click Calculate
How It Works
The calculator constructs JavaScript Date objects from the year, month, and day inputs and normalizes both to midnight (00:00:00) to eliminate any time-of-day ambiguity. It then checks that the end date is not earlier than the start date. The core algorithm iterates day-by-day from the start date to the end date using a while loop. On each iteration, it checks the day-of-week value (0 = Sunday, 6 = Saturday). Days with values 1–5 are always counted as business days. Days with values 0 or 6 increment the weekend counter and are added to the business day total only if the countWeekends toggle is enabled. The includeEndDate toggle controls whether the loop's boundary condition uses a strict less-than or a less-than-or-equal comparison, making it easy to switch between exclusive and inclusive counting conventions. Total calendar days and weekend days are tracked in parallel for transparency.