Data Source and Methodology
This tool's date calculations are based on the Gregorian calendar, the international standard for civil use. All date representations and weekday calculations conform to the ISO 8601 standard.
All calculations are performed using a precise day-by-day iteration algorithm. The calculator loops through each day in the specified range and checks it against two user-defined sets of rules:
- Weekend Days: A list of days of the week (e.g., Saturday, Sunday) to exclude.
- Holidays: A specific list of calendar dates (e.g., 2025-12-25) to exclude.
The Algorithm Explained
A simple mathematical formula is not sufficient for this task due to the variable nature of weekends and holidays. A rough estimation can be made with LaTeX: $N_{workdays} \approx \lfloor \Delta_{days} \times \frac{5}{7} \rfloor - N_{holidays}$ (Where $\Delta_{days}$ is the total days and $N_{holidays}$ is holidays on weekdays).
This calculator does not use that estimation. It uses a precise iterative algorithm, represented in pseudocode below, to ensure 100% accuracy.
Algorithm for Counting Workdays
function countWorkdays(startDate, endDate, weekends, holidays):
workdayCount = 0
currentDate = startDate
while currentDate <= endDate:
dayOfWeek = getDay(currentDate)
isHoliday = holidays.contains(currentDate)
isWeekend = weekends.contains(dayOfWeek)
if NOT isWeekend and NOT isHoliday:
workdayCount = workdayCount + 1
currentDate = addOneDay(currentDate)
return workdayCount
Algorithm for Adding Workdays
function addWorkdays(startDate, daysToAdd, weekends, holidays):
workdayCount = 0
currentDate = startDate
while workdayCount < daysToAdd:
currentDate = addOneDay(currentDate)
dayOfWeek = getDay(currentDate)
isHoliday = holidays.contains(currentDate)
isWeekend = weekends.contains(dayOfWeek)
if NOT isWeekend and NOT isHoliday:
workdayCount = workdayCount + 1
return currentDate
Glossary of Variables
- Start Date: The first day of the period, or the day from which to add/subtract.
- End Date: The last day of the period.
- Include Start/End Date: Checkboxes to determine if the start and end dates themselves should be part of the calculation. By default, we include the end date but not the start date (common for "time until" calculations).
- Workdays (to Add/Subtract): The number of business days to project forward or backward.
- Weekend Days: Days of the week to exclude from all calculations.
- Holidays: Specific calendar dates to exclude. These are treated as non-working days, even if they fall on a weekday.
- Total Workdays: The final count of days that are neither weekends nor holidays.
How It Works: A Step-by-Step Example
Let's calculate the workdays for a project starting on Monday, December 22, 2025, and ending on Friday, January 2, 2026. We want to include both the start and end dates in our count.
- Start Date: 2025-12-22
- End Date: 2026-01-02
- Include Start Date: Yes
- Include End Date: Yes
- Weekends: Saturday, Sunday
- Holidays: 2025-12-25 (Christmas Day), 2026-01-01 (New Year's Day)
The algorithm will iterate as follows:
| Date | Day of Week | Type | Is Workday? | Count |
|---|---|---|---|---|
| Dec 22, 2025 | Monday | Start Date | Yes | 1 |
| Dec 23, 2025 | Tuesday | Yes | 2 | |
| Dec 24, 2025 | Wednesday | Yes | 3 | |
| Dec 25, 2025 | Thursday | Holiday | No | - |
| Dec 26, 2025 | Friday | Yes | 4 | |
| Dec 27, 2025 | Saturday | Weekend | No | - |
| Dec 28, 2025 | Sunday | Weekend | No | - |
| Dec 29, 2025 | Monday | Yes | 5 | |
| Dec 30, 2025 | Tuesday | Yes | 6 | |
| Dec 31, 2025 | Wednesday | Yes | 7 | |
| Jan 1, 2026 | Thursday | Holiday | No | - |
| Jan 2, 2026 | Friday | End Date | Yes | 8 |
Result: The total count is 8 workdays.
Frequently Asked Questions (FAQ)
How do I count inclusively of the start and end dates?
In the "Count Workdays" tab, check both the "Include Start Date" and "Include End Date" boxes. This will count both the first and last day if they are workdays.
What format must I use for holidays?
You must use the ISO 8601 format: YYYY-MM-DD. For example, 2025-07-04. Each holiday must be on its own line in the text box.
Does this calculator handle leap years?
Yes. The calculator uses the standard Gregorian calendar, which correctly accounts for leap years (like February 29th). All date iterations are accurate.
Can I define a 4-day work week?
Yes. In the "Define Weekend" section, simply check the boxes for the days you do not work. For example, to set a Monday-Thursday work week, you would check Friday, Saturday, and Sunday.
What time zone is used for calculations?
The calculator operates on calendar dates (midnight to midnight) without respect to time zones. When you enter '2025-12-25', it is treated as that full calendar day. This avoids confusion and errors related to local time zones or Daylight Saving Time.
What happens if a holiday falls on a weekend?
The day will be counted as a single "non-workday." Our algorithm first checks if a day is a weekend, then checks if it's a holiday. In the results, it will be counted as a "Weekend Day" and will not be double-counted as a holiday.
Tool developed by Ugo Candido. Content verified by the CalcDomain Editorial Board.
Last accuracy review: