function calculateFreelanceRate() {
var salary = parseFloat(document.getElementById('desiredSalary').value);
var expenses = parseFloat(document.getElementById('annualExpenses').value);
var hoursPerWeek = parseFloat(document.getElementById('billableHours').value);
var vacation = parseFloat(document.getElementById('vacationWeeks').value);
var taxRate = parseFloat(document.getElementById('taxRate').value) / 100;
if (isNaN(salary) || isNaN(expenses) || isNaN(hoursPerWeek) || isNaN(vacation)) {
alert("Please enter valid numbers in all fields.");
return;
}
// Total gross income needed (Salary / (1 – tax) + expenses)
var totalRequiredGross = (salary / (1 – taxRate)) + expenses;
// Working weeks in a year
var workingWeeks = 52 – vacation;
// Total billable hours per year
var totalAnnualHours = workingWeeks * hoursPerWeek;
if (totalAnnualHours <= 0) {
alert("Working weeks and hours must be greater than zero.");
return;
}
var hourlyRate = totalRequiredGross / totalAnnualHours;
var resultDiv = document.getElementById('resultArea');
var rateDisplay = document.getElementById('hourlyResult');
var breakdownDisplay = document.getElementById('breakdownText');
rateDisplay.innerText = "$" + hourlyRate.toFixed(2);
breakdownDisplay.innerHTML = "To take home $" + salary.toLocaleString() + " after taxes, you need to earn a gross annual income of $" + Math.round(totalRequiredGross).toLocaleString() + " based on " + totalAnnualHours + " billable hours per year.";
resultDiv.style.display = 'block';
}
How to Calculate Your Freelance Hourly Rate
Setting your freelance rate is one of the most critical steps in building a sustainable business. Many new freelancers make the mistake of simply converting a previous salary into an hourly rate, forgetting that as a freelancer, you are responsible for your own taxes, insurance, equipment, and unbillable hours (like marketing and invoicing).
The "Bottom-Up" Formula
This calculator uses the bottom-up approach, which ensures all your costs are covered. The formula is:
Hourly Rate = (Desired Net Income + Taxes + Business Expenses) / (Working Weeks × Billable Hours Per Week)
Key Factors to Consider
Billable vs. Non-Billable Hours: You likely won't spend 40 hours a week on client work. You need to account for "admin time"—marketing, discovery calls, and bookkeeping. Most freelancers find that 20–25 billable hours is a full-time load.
Tax Liability: Unlike employees, freelancers pay the full portion of self-employment taxes. Depending on your location, we recommend setting aside 25-35% of your gross income for taxes.
The "Profit" Margin: Once you find your base rate, consider adding a 10-20% margin for business growth and emergency savings.
Example Calculation
If you want to take home $70,000 a year, have $6,000 in expenses, live in a 25% tax bracket, and want 4 weeks of vacation while working 25 billable hours per week:
Gross income needed: ($70,000 / 0.75) + $6,000 = $99,333