function calculateFreelanceRate() {
var personalExp = parseFloat(document.getElementById('personalExpenses').value) || 0;
var businessExp = parseFloat(document.getElementById('businessExpenses').value) || 0;
var profit = parseFloat(document.getElementById('annualProfit').value) || 0;
var tax = parseFloat(document.getElementById('taxRate').value) || 0;
var hoursWk = parseFloat(document.getElementById('hoursPerWeek').value) || 0;
var weeksYr = parseFloat(document.getElementById('weeksPerYear').value) || 0;
var nonBillablePct = parseFloat(document.getElementById('nonBillable').value) || 0;
if (hoursWk <= 0 || weeksYr <= 0) {
alert("Please enter valid working hours and weeks.");
return;
}
// 1. Calculate Total Annual Needs (Net)
var annualPersonal = personalExp * 12;
var annualBusiness = businessExp * 12;
var totalNetRequired = annualPersonal + annualBusiness + profit;
// 2. Adjust for Taxes (Gross Revenue Target)
// Gross = Net / (1 – TaxRate)
var taxDecimal = tax / 100;
var targetGross = totalNetRequired / (1 – taxDecimal);
// 3. Calculate Billable Hours
var totalPotentialHours = hoursWk * weeksYr;
var billableHours = totalPotentialHours * (1 – (nonBillablePct / 100));
if (billableHours <= 0) {
alert("Non-billable percentage is too high. You have no hours left to charge!");
return;
}
// 4. Calculate Final Hourly Rate
var hourlyRate = targetGross / billableHours;
// Display Results
document.getElementById('resultArea').style.display = 'block';
document.getElementById('finalRate').innerHTML = '$' + hourlyRate.toFixed(2) + '/hr';
document.getElementById('targetRevenue').innerHTML = '$' + targetGross.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('totalBillableHours').innerHTML = Math.round(billableHours) + ' hrs';
document.getElementById('resultArea').scrollIntoView({ behavior: 'smooth' });
}
How to Calculate Your Freelance Hourly Rate
Transitioning from a salaried position to freelancing often leads to the most common mistake: simply dividing your old salary by 2,000 hours. This fails to account for taxes, overhead, and the reality of non-billable time. To build a sustainable business, you must use a value-based or cost-plus pricing strategy.
The "Cost-Plus" Formula
To find your minimum viable hourly rate, follow this calculation logic:
Total Annual Expenses: Sum of your personal survival costs (rent, food, insurance) and business costs (software, hardware, marketing).
The Tax Buffer: Unlike employees, freelancers pay the full portion of self-employment taxes. You must increase your net requirement by your tax bracket.
The Billable Hour Reality: You cannot bill 40 hours a week. You must spend time on invoicing, pitching, and learning. Most freelancers find that only 60% to 75% of their time is actually billable.
Example Calculation
Imagine you need $50,000 for personal life and $10,000 for business expenses. You want $10,000 in profit (savings). Your total net need is $70,000. If your tax rate is 25%, you actually need to earn approximately $93,333 in gross revenue.
If you work 48 weeks a year at 40 hours a week, but 30% of that is admin time, you have 1,344 billable hours. Dividing $93,333 by 1,344 hours gives you an hourly rate of $69.44.
Factors Often Overlooked
Health Insurance: You are now responsible for 100% of your premiums.
Retirement: There is no company 401k match. You must build this into your "Profit" section.
Equipment Depreciation: Your laptop will need replacing every 3 years. That is a business expense.
Vacation & Sick Days: If you don't work, you don't get paid. Use the "Working Weeks Per Year" input to account for 2-4 weeks of unpaid time off.