A pro rata bonus is a payment calculated proportionately based on the period of time an employee has worked during a specific bonus cycle. Unlike a flat bonus, which pays the full amount regardless of start date, a prorated calculation ensures fairness for employees who joined the company mid-year or left before the bonus period ended.
How to Calculate Your Pro Rata Bonus
The calculation follows a simple logic based on the number of days you were eligible for the bonus compared to the total number of days in the bonus period.
The Formula:
Step 1: Determine the total days in the bonus period (e.g., 365 days for a full calendar year).
Step 2: Calculate the number of days you were employed and eligible during that specific period.
Step 3: Divide eligible days by total days to get your Pro Rata Percentage.
Step 4: Multiply the full target bonus amount by this percentage.
Formula: (Eligible Days / Total Period Days) × Full Bonus Amount = Prorated Bonus
Example Scenario
Imagine the company fiscal year runs from January 1st to December 31st (365 days). You have a target annual bonus of $10,000.
Scenario A (New Hire): You join the company on July 1st. You worked 184 days of the year. Your calculation is (184 / 365) × $10,000 = $5,041.10.
Scenario B (Leaving Early): You started on Jan 1st but left on March 31st. You worked 90 days. Your calculation is (90 / 365) × $10,000 = $2,465.75.
Why Dates Matter
Precision is key. Most HR departments calculate bonuses based on calendar days, including weekends and holidays. This calculator uses "inclusive" logic, meaning if you work from the 1st to the 1st, that counts as 1 day of employment. Ensure your start and end dates match your official employment contract.
function calculateBonus() {
// Get inputs
var fullBonus = parseFloat(document.getElementById('fullBonusAmount').value);
var periodStartStr = document.getElementById('periodStart').value;
var periodEndStr = document.getElementById('periodEnd').value;
var empStartStr = document.getElementById('empStart').value;
var empEndStr = document.getElementById('empEnd').value;
var errorDiv = document.getElementById('error-message');
var resultArea = document.getElementById('result-area');
// Reset UI
errorDiv.style.display = 'none';
resultArea.style.display = 'none';
errorDiv.innerHTML = ";
// Validation
if (isNaN(fullBonus)) {
showError("Please enter a valid bonus amount.");
return;
}
if (!periodStartStr || !periodEndStr || !empStartStr) {
showError("Please fill in the Bonus Period dates and your Employment Start Date.");
return;
}
// Create Date objects (set to midnight to avoid timezone offsets affecting day counts)
var pStart = new Date(periodStartStr);
var pEnd = new Date(periodEndStr);
var eStart = new Date(empStartStr);
// Handle optional termination date
var eEnd;
if (empEndStr) {
eEnd = new Date(empEndStr);
} else {
// If currently employed, assume employment covers the rest of the period for calculation purposes
// Or cap at period end. Usually, pro rata assumes you work through the end if not specified.
// We will treat "no end date" as "still employed at end of period" -> cap at pEnd
eEnd = new Date(periodEndStr);
// However, to be safe conceptually, let's just set it to a future date far away so Math.min catches pEnd.
eEnd = new Date('2999-12-31');
}
// Logical checks
if (pEnd < pStart) {
showError("Bonus Period End Date cannot be before Start Date.");
return;
}
if (empEndStr && eEnd < eStart) {
showError("Termination Date cannot be before Employment Start Date.");
return;
}
// 1. Calculate Total Days in Bonus Period (Inclusive)
// Milliseconds per day = 1000 * 60 * 60 * 24
var oneDay = 86400000;
var totalPeriodDays = Math.round((pEnd – pStart) / oneDay) + 1;
if (totalPeriodDays pStart) ? eStart : pStart;
// Determine effective end (earliest of period end vs emp end)
var effectiveEnd = (eEnd < pEnd) ? eEnd : pEnd;
// Calculate duration
var eligibleDays = 0;
// Only calculate if there is an actual overlap
if (effectiveStart pEnd) {
eligibleDays = 0;
}
// Edge Case: If employee left before period started
if (eEnd < pStart) {
eligibleDays = 0;
}
// 3. Calculate Percentage and Amount
var percentage = (eligibleDays / totalPeriodDays);
var proratedAmount = fullBonus * percentage;
// Display Results
document.getElementById('res-total-days').innerText = totalPeriodDays;
document.getElementById('res-eligible-days').innerText = eligibleDays;
document.getElementById('res-percentage').innerText = (percentage * 100).toFixed(2) + "%";
// Format currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('res-bonus-amount').innerText = formatter.format(proratedAmount);
resultArea.style.display = 'block';
}
function showError(msg) {
var el = document.getElementById('error-message');
el.innerHTML = msg;
el.style.display = 'block';
}