Leave / PTO calculator: accrued leave, taken leave, and ending balance
This leave / PTO calculator helps you calculate paid time off for a selected reporting period. It shows how much leave was accrued, how much leave was taken, and what the final ending balance is after carryover and optional caps.
This answers a common HR and payroll question: how much PTO should an employee have available at the end of a period?
Instead of relying only on calendar days, the calculator uses working time. It can account for selected weekdays, public holidays, regional holidays, and workday duration, making it suitable for real-world payroll and HR scenarios.
How PTO accrual works
PTO accrual is the process of earning leave over time. Depending on company policy, leave can be accrued monthly, yearly, per working day, or per hour worked.
The calculation follows a simple structure:
- define the reporting period (for example, a month or year)
- apply the accrual rule over that period
- add any starting balance (carryover)
- subtract leave already taken
- apply an optional balance cap
In practice:
ending balance = starting balance + accrued leave - taken leave
If a maximum balance is configured, the result can be capped to reflect company policy limits.
Accrual methods supported
The calculator supports multiple accrual approaches to match different PTO policies:
- hours per month (for standard monthly accrual policies)
- hours per year (distributed across the reporting period)
- hours per workday (based on actual working days)
This flexibility allows you to model both simple and more advanced PTO systems without changing the underlying logic.
Why working days matter for PTO
Leave calculations are more accurate when based on working days instead of calendar days. Weekends and public holidays are usually not counted as taken leave.
Working-day-based PTO calculations are useful because:
- they reflect actual scheduled work time
- they exclude public holidays automatically
- they support regional holiday differences
- they align better with payroll and HR practices
This is especially important for international teams, where working schedules and public holidays differ across countries and regions.
Taken leave and leave windows
The calculator can estimate taken leave from one or more leave windows within the reporting period. It counts only working time inside those windows.
This helps with real-world scenarios such as:
- vacation spanning multiple days
- leave overlapping weekends or public holidays
- partial absences within a payroll period
- leave across different regions with different holidays
You can also provide a direct override if the taken leave amount is already known from an HR system.
Public holidays and regional differences
Public holidays are applied automatically based on the selected country. If a subdivision or region is selected, regional holidays are also excluded from working time.
This ensures that PTO calculations reflect local conditions. Two employees in different regions may have different working-day counts and therefore different leave calculations.
Custom work schedules
By default, the calculator assumes a standard Monday to Friday workweek. You can adjust this using predefined schedules such as:
- Monday to Saturday
- Sunday to Thursday
- every day
This makes the calculator suitable for industries with non-standard schedules, including retail, logistics, and shift-based operations.
Workday duration and PTO in hours
PTO is often tracked in hours rather than days. The calculator uses workday duration to convert between hours and days for easier interpretation.
For example, if one workday is 8 hours, then 16 hours of leave equals 2 working days. This allows teams to keep precise hour-based tracking while still presenting results in a familiar day-based format.
Balance caps and carryover
Many PTO policies include a maximum balance cap. Once the cap is reached, additional accrued leave is either limited or stopped.
The calculator allows you to define:
- starting balance (carryover from previous periods)
- maximum allowed balance
This helps simulate real HR policies where unused leave can be carried over but only up to a defined limit.
Using PTO calculations in your own software
This page is designed for quick calculations. For automation, you can use the HolidayDB APIs.
Developers can use the authenticated endpoint documented here: GET /api/leave-pto.
Public holiday rules come from GET /api/holidays, so your PTO logic can stay consistent with real holiday calendars without maintaining your own holiday dataset.
