When working with dates in JavaScript , calculating the difference between two dates is easy if you only need calendar days.
But in real business use cases, we often need to calculate business days , also called working days .
Business days usually exclude Saturdays and Sundays. In some cases, public holidays also need to be excluded.
I created a free online Business Days Calculator for checking this quickly:
https://greatuptools.com/business-days-calculator
What are business days?
Business days usually mean Monday to Friday.
Saturday and Sunday are normally excluded because they are weekends.
For example:
Business days: Monday, Tuesday, Wednesday, Thursday, Friday
Weekend days: Saturday, Sunday
Basic JavaScript date difference
If you only want the number of calendar days between two dates, you can subtract two dates in JavaScript :
Code example:
const startDate = new Date("2026-01-01");
const endDate = new Date("2026-12-31");
const millisecondsPerDay = 1000 * 60 * 60 * 24;
const…