This calculator determines the correct overtime pay when an employee works at two different hourly rates within a single workweek, based on the weighted average (blended rate) method typically required by labor regulations like the FLSA.
Position / Job 1 Details
Position / Job 2 Details
Please enter valid, positive numbers for all rates and hours.
function calculateWeightedOvertime() {
// 1. Get inputs using var
var rate1Input = document.getElementById('ot_rate1').value;
var hours1Input = document.getElementById('ot_hours1').value;
var rate2Input = document.getElementById('ot_rate2').value;
var hours2Input = document.getElementById('ot_hours2').value;
var resultDiv = document.getElementById('ot-calc-result');
var errorDiv = document.getElementById('ot-calc-error-msg');
// Reset previous displays
resultDiv.style.display = 'none';
resultDiv.innerHTML = ";
errorDiv.style.display = 'none';
// 2. Parse inputs to floats
var r1 = parseFloat(rate1Input);
var h1 = parseFloat(hours1Input);
var r2 = parseFloat(rate2Input);
var h2 = parseFloat(hours2Input);
// 3. Validate inputs (handle NaN and negatives)
if (isNaN(r1) || r1 < 0) r1 = 0;
if (isNaN(h1) || h1 < 0) h1 = 0;
if (isNaN(r2) || r2 < 0) r2 = 0;
if (isNaN(h2) || h2 < 0) h2 = 0;
var totalHours = h1 + h2;
// Basic validation: Need hours to calculate
if (totalHours overtimeThreshold) {
overtimeHours = totalHours – overtimeThreshold;
}
// Step D: Calculate Overtime Premium Pay
// The employee has already been paid straight time for all hours.
// They are owed the extra 0.5x the regular rate for OT hours.
var overtimePremiumRate = weightedRegularRate * 0.5;
var totalOvertimePremiumPay = overtimeHours * overtimePremiumRate;
// Step E: Total Gross Pay
var totalGrossPay = totalStraightTimeEarnings + totalOvertimePremiumPay;
// 5. Output Results
var outputHTML = '
Total Hours Worked:' + totalHours.toFixed(2) + ' hrs
';
outputHTML += '
Total Straight-Time Earnings:$' + totalStraightTimeEarnings.toFixed(2) + '
';
outputHTML += '
Weighted Average Regular Rate:$' + weightedRegularRate.toFixed(2) + ' /hr
When an employee works at two or more different rates of pay in a single workweek, federal regulations (such as the FLSA in the United States) generally require that overtime pay be calculated using a "weighted average" of those rates. You cannot simply pay overtime based on the rate of the specific job performed during the overtime hours, nor can you arbitrarily choose the lower rate.
The weighted average regular rate is calculated by dividing total straight-time earnings for the week by the total hours worked.
The Calculation Steps Explained
Calculate Straight-Time Earnings: Multiply the hours worked at each specific job by its corresponding hourly rate. Sum these amounts together to get total straight-time earnings.
Calculate Total Hours: Add together all hours worked across all positions.
Determine the Regular Rate: Divide Total Straight-Time Earnings by Total Hours Worked. This gives you the weighted average "Regular Rate."
Calculate Overtime Premium: For any hours worked over 40, the employee is owed an additional "half-time" premium based on the Regular Rate calculated in Step 3. (Regular Rate x 0.5 x Overtime Hours).
Total Pay: Add the Total Straight-Time Earnings plus the calculated Overtime Premium.
Realistic Example
Imagine an employee, Sarah, has two roles.
Role A: $20.00/hr. She works 30 hours.
Role B: $25.00/hr. She works 20 hours.
Total Hours worked: 50 hours (10 hours of overtime).
The wrong way: Paying time-and-a-half on $20/hr for the extra 10 hours.
The correct weighted way:
Straight time: (30 hrs x $20) + (20 hrs x $25) = $600 + $500 = $1,100.