Compare average hourly earnings to determine the wage gap percentage.
$
$
Used to estimate annual loss.
Raw Hourly Difference:$0.00
Gender Pay Gap (%):0.00%
Women Earn Per Dollar:0 cents
Estimated Annual Loss:$0.00
function calculateGenderPayGap() {
// Get input values using var
var maleRate = parseFloat(document.getElementById('maleHourlyRate').value);
var femaleRate = parseFloat(document.getElementById('femaleHourlyRate').value);
var hours = parseFloat(document.getElementById('weeklyHours').value);
// Validation
if (isNaN(maleRate) || isNaN(femaleRate) || maleRate <= 0 || femaleRate < 0) {
alert("Please enter valid positive hourly rates.");
return;
}
if (isNaN(hours) || hours 0) {
payGapPercent = (hourlyDiff / maleRate) * 100;
}
var centsPerDollar = (femaleRate / maleRate) * 100;
// Annual loss calculation (52 weeks)
var annualLoss = hourlyDiff * hours * 52;
// Display Results
document.getElementById('gpgResult').style.display = 'block';
document.getElementById('diffResult').innerText = '$' + hourlyDiff.toFixed(2);
document.getElementById('percentResult').innerText = payGapPercent.toFixed(2) + '%';
document.getElementById('ratioResult').innerText = Math.round(centsPerDollar) + ' cents';
document.getElementById('annualLossResult').innerText = '$' + annualLoss.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
// Styling based on result
var percentElem = document.getElementById('percentResult');
var lossElem = document.getElementById('annualLossResult');
var interpretBox = document.getElementById('interpretationText');
var interpretText = "";
if (payGapPercent > 0) {
percentElem.className = "gpg-result-value gpg-highlight";
lossElem.style.color = "#e74c3c"; // Red
interpretText = "Gap Detected: On average, women in this dataset earn " + Math.round(centsPerDollar) + " cents for every dollar men earn. Over a year (based on " + hours + " hours/week), this accumulates to a financial disparity of $" + annualLoss.toLocaleString('en-US', {maximumFractionDigits: 0}) + ".";
} else if (payGapPercent < 0) {
percentElem.className = "gpg-result-value gpg-highlight-green";
lossElem.style.color = "#27ae60"; // Green
interpretText = "Negative Gap: In this scenario, the female average hourly rate is higher than the male rate by " + Math.abs(payGapPercent).toFixed(2) + "%.";
} else {
percentElem.className = "gpg-result-value";
lossElem.style.color = "#2c3e50";
interpretText = "Pay Parity: There is no discernible difference between the average hourly rates entered.";
}
interpretBox.innerHTML = interpretText;
}
Understanding the Gender Pay Gap Hourly Rate Calculation
The gender pay gap is a critical economic metric that measures the difference in average earnings between men and women. While often discussed in terms of annual salary, calculating the hourly rate pay gap provides a more precise comparison by controlling for the number of hours worked. This calculator helps organizations, analysts, and individuals quantify this disparity using standard statistical methods.
The Calculation Formula
The standard formula used by international bodies like the OECD and the Bureau of Labor Statistics determines the unadjusted gender pay gap as a percentage of male earnings. The formula is:
For example, if the average male hourly rate is $40.00 and the average female hourly rate is $32.00, the calculation would be:
(($40 – $32) ÷ $40) × 100 = 20%. This means the gender pay gap is 20%, or conversely, women earn 80 cents for every dollar earned by men.
Why Use Hourly Rates Instead of Annual Salary?
Using hourly rates is often preferred for accurate analysis because it removes the variable of "time worked."
Part-Time Work: Women are statistically more likely to work part-time positions. Comparing total annual income without adjusting for hours worked can inflate the gap.
Overtime: Hourly calculations strip away overtime variances, focusing strictly on the base value attributed to an hour of labor.
Direct Comparison: It allows for a clearer "apples-to-apples" comparison of compensation for similar time investments.
Understanding the Results
The Percentage Gap: This figure represents the "tax" on female earnings relative to male earnings. A positive number indicates men earn more, while a negative number indicates women earn more.
Cents on the Dollar: This is a common visualization of the gap. If the gap is 18%, women earn 82 cents for every dollar a man makes.
Annualized Loss: Even a small hourly difference accumulates significantly over time. A $5 hourly gap translates to over $10,000 in lost income per year for a full-time worker, impacting lifetime earnings, retirement savings, and economic independence.
Adjusted vs. Unadjusted Gap
This calculator determines the unadjusted pay gap, which compares average earnings across all jobs. An adjusted pay gap calculation would account for factors such as job title, education, years of experience, and industry. While the adjusted gap is typically smaller, the unadjusted gap remains a vital metric for understanding structural inequalities and opportunity gaps in the workforce.