body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
color: #333;
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
.calculator-container {
background-color: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 30px;
margin-bottom: 40px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.calc-title {
text-align: center;
margin-bottom: 25px;
color: #2c3e50;
font-size: 24px;
font-weight: 700;
}
.input-group {
margin-bottom: 20px;
}
.input-row {
display: flex;
gap: 20px;
margin-bottom: 15px;
flex-wrap: wrap;
}
.input-col {
flex: 1;
min-width: 200px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #495057;
}
input[type="number"] {
width: 100%;
padding: 12px;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 16px;
transition: border-color 0.15s ease-in-out;
box-sizing: border-box;
}
input[type="number"]:focus {
border-color: #007bff;
outline: 0;
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.section-header {
font-size: 14px;
text-transform: uppercase;
letter-spacing: 1px;
color: #6c757d;
margin-bottom: 10px;
border-bottom: 1px solid #dee2e6;
padding-bottom: 5px;
}
button.calc-btn {
width: 100%;
padding: 15px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.2s;
margin-top: 10px;
}
button.calc-btn:hover {
background-color: #0056b3;
}
.results-area {
margin-top: 25px;
background-color: #ffffff;
border: 1px solid #dee2e6;
border-radius: 4px;
padding: 20px;
display: none;
}
.result-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 0;
border-bottom: 1px solid #f1f3f5;
}
.result-row:last-child {
border-bottom: none;
padding-top: 15px;
margin-top: 5px;
}
.result-label {
color: #6c757d;
font-size: 16px;
}
.result-value {
font-weight: 700;
font-size: 18px;
color: #212529;
}
.final-result {
font-size: 24px;
color: #28a745;
}
.article-content {
margin-top: 50px;
font-size: 18px;
line-height: 1.8;
}
.article-content h2 {
color: #2c3e50;
margin-top: 40px;
}
.article-content h3 {
color: #34495e;
margin-top: 30px;
}
.article-content ul {
margin-bottom: 20px;
}
.example-box {
background-color: #e8f4fd;
padding: 20px;
border-left: 4px solid #007bff;
margin: 20px 0;
}
@media (max-width: 600px) {
.input-row {
flex-direction: column;
gap: 10px;
}
}
function calculateAvgRate() {
// Get input values
var baseHours = parseFloat(document.getElementById('baseHours').value) || 0;
var baseRate = parseFloat(document.getElementById('baseRate').value) || 0;
var otHours = parseFloat(document.getElementById('otHours').value) || 0;
var otRate = parseFloat(document.getElementById('otRate').value) || 0;
var bonusPay = parseFloat(document.getElementById('bonusPay').value) || 0;
var unpaidHours = parseFloat(document.getElementById('unpaidHours').value) || 0;
// Calculate components
var basePay = baseHours * baseRate;
var otPay = otHours * otRate;
// Calculate totals
var totalEarnings = basePay + otPay + bonusPay;
var totalHours = baseHours + otHours + unpaidHours;
// Prevent division by zero
var avgRate = 0;
if (totalHours > 0) {
avgRate = totalEarnings / totalHours;
}
// Display Results
document.getElementById('displayTotalEarnings').innerHTML = '$' + totalEarnings.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('displayTotalHours').innerHTML = totalHours.toFixed(2) + ' hrs';
document.getElementById('displayAvgRate').innerHTML = '$' + avgRate.toLocaleString('en-US', {minimumFractionDigits: 2, maximumFractionDigits: 2}) + ' / hr';
// Show result div
document.getElementById('resultArea').style.display = 'block';
}
How to Calculate Average Hourly Rate
Calculating your average hourly rate—often called your "effective hourly rate"—is essential for freelancers, employees with mixed pay structures, and business owners. While your contract might state a specific hourly wage, your actual earnings per hour can fluctuate based on overtime, bonuses, unpaid administrative work, or juggling multiple clients at different rates.
This calculator helps you determine the true value of your time by aggregating all income sources and dividing them by the total hours invested in your work.
The Average Hourly Rate Formula
The core concept behind the average hourly rate is a weighted average calculation. The formula is straightforward:
Average Hourly Rate = Total Earnings / Total Hours Worked
Where:
- Total Earnings: The sum of all wages, overtime pay, bonuses, commissions, and fixed stipends.
- Total Hours Worked: The sum of all billable hours, overtime hours, and non-billable administrative hours (if calculating true effective rate).
Why Your Effective Rate Might Be Different
Even if you are paid a steady $25/hour, your effective average rate might differ. Here are two common scenarios:
1. The "Overtime" Scenario (Rate Increase)
If you work overtime at 1.5x your normal rate, your average hourly rate for that week increases. For example, working 40 hours at $20 and 10 hours at $30 results in a higher weighted average than your base pay.
2. The "Freelancer" Scenario (Rate Decrease)
Freelancers often bill clients at a high rate, say $100/hour. However, if they spend 10 hours on the project and another 5 hours on unpaid invoices, emails, and marketing, the total hours worked is 15. This lowers the effective average hourly rate significantly.
Real-World Calculation Example
Let's look at a complex week to see how the math works:
- Regular Work: 40 hours @ $20/hr = $800
- Overtime: 5 hours @ $30/hr = $150
- Performance Bonus: $100 lump sum
- Unpaid Commute/Prep: 2 hours (optional inclusion)
Step 1: Calculate Total Earnings
$800 (Regular) + $150 (Overtime) + $100 (Bonus) = $1,050
Step 2: Calculate Total Hours
40 (Regular) + 5 (Overtime) + 2 (Unpaid) = 47 Hours
Step 3: Divide Earnings by Hours
$1,050 / 47 = $22.34 per hour
In this example, despite the base rate being $20, the overtime and bonus pushed the average up, even after accounting for unpaid prep time.
When to Use This Calculator
- Salary to Hourly Conversion: If you are salaried but work varying hours, divide your weekly salary by actual hours worked to see your effective hourly wage.
- Comparing Job Offers: Job A pays less per hour but offers significant bonuses. Job B pays more per hour but no overtime. Use the weighted average to compare apples to apples.
- Project Management: Determine if a fixed-fee project was profitable by inputting the fee as a bonus/fixed amount and tracking total hours spent.