Gross margin for agencies: how to calculate it
The gross margin formula, what counts as a direct cost in a service business, and a quarterly worked example for a design studio showing how leaving out wages inflates the answer.

Gross margin tells you how much of every dollar of revenue is left after the cost of delivering the work. For a service business, the number is only useful if you decide what counts as a delivery cost and stay with that decision. This post gives you the formula, a list of direct costs, and a worked example.
The formula
Gross profit = revenue - direct costs.
Gross margin % = gross profit / revenue x 100.
Direct costs are the costs of delivering client work. Overhead, such as rent, admin and marketing, sits below gross profit and belongs in your overhead rate or your net profit calculation, not here.
What counts as a direct cost in an agency
Include costs that exist because you delivered client work.
- Delivery wages. The pay and employer costs of people who do the work, for the time they spend on client projects.
- Contractors. Freelancers and subcontractors working on client jobs.
- Project-specific software and licenses. Anything bought for a particular client or project.
- Media and materials. Stock, printing, hosting set up for the client.
- Paid media you buy for clients, if you include it in revenue.
Leave out these costs, which belong in overhead.
- Rent and utilities.
- Admin, finance and management salaries.
- Sales and marketing.
- Tools every team member uses regardless of client.
- Professional fees and insurance.
Two judgment calls come up often. One is partly billable people, such as a founder who spends 40% of the week on client work. Include 40% of their pay as direct cost, and the rest in overhead. The other is non-billable delivery time, such as internal review of client work. Include it, because the client work caused it. How often you communicate with clients affects this directly, since calls and status emails are delivery hours.
A worked example for a quarter
Take a hypothetical design studio with revenue of $120,000 for the quarter.
Direct costs:
- Delivery wages for time on client work: $54,000.
- Contractors: $12,000.
- Project-specific licenses and media: $3,000.
Total direct costs: $54,000 + $12,000 + $3,000 = $69,000.
- Gross profit: $120,000 - $69,000 = $51,000.
- Gross margin: $51,000 / $120,000 = 0.425, or 42.5%.
So for every $1 of revenue, 42.5 cents remain to cover overhead and leave a profit.
What happens if you leave out wages
Some owners count only contractors and licenses as direct costs, because wages are paid anyway. Here, that gives direct costs of $12,000 + $3,000 = $15,000.
- Gross profit: $120,000 - $15,000 = $105,000.
- Gross margin: $105,000 / $120,000 = 0.875, or 87.5%.
A margin of 87.5% suggests nearly everything is profit, but $54,000 of delivery wages is the main cost of the business. Use the full-cost version for decisions about pricing and workload.
Compare periods, not just numbers
A single margin is a snapshot. Compare it with last quarter and the same quarter last year. Then split it:
- By service line. Branding, web and retainers will differ.
- By client. This is the method in how to find out which clients and projects are really profitable.
- By project, once it closes.
Imagine the studio's web line has revenue of $70,000 and direct costs of $45,500.
- Gross profit: $70,000 - $45,500 = $24,500.
- Margin: $24,500 / $70,000 = 0.35, or 35%.
The remaining lines must then have revenue of $120,000 - $70,000 = $50,000 and direct costs of $69,000 - $45,500 = $23,500, a profit of $26,500 and a margin of $26,500 / $50,000 = 53%. Web is the weaker line, and you can look for the cause: underpriced scope, too much contractor time, or both.
Set a target from your own costs
Do not borrow a target from someone else's business. Work backwards from yours. Suppose overhead is 30% of revenue and you want a net profit of 15%.
- Required gross margin: 30% + 15% = 45%.
- On $120,000 of revenue: overhead is $36,000, profit is $18,000, so gross profit must be $54,000, which is 45% of $120,000.
The studio in the example earns 42.5%, or $51,000. The gap is $54,000 - $51,000 = $3,000 for the quarter. That tells you what to fix: price, delivery cost or both.
Reading a fall in margin
When margin drops, look for the cause in this order: price (did you quote lower), hours (did jobs run over estimate), contractors (did you buy in more help than planned) and discounts. Suppose the studio's margin falls from 42.5% to 38% on the same $120,000 of revenue.
- Gross profit at 38%: $120,000 x 0.38 = $45,600.
- Lost gross profit: $51,000 - $45,600 = $5,400.
The size of the loss tells you how much effort the fix deserves, and which of the four causes accounts for it.
Keep the data clean
The margin is only as good as the inputs.
- Record time against projects, including internal and non-billable time on client work.
- Code each expense to a category when you enter it. Expense tracking for agencies lists categories that make this easy.
- Use the same definition of direct cost each period. Write it down.
Do not worry about a precise answer. Consistency matters more than perfection, because decisions come from changes over time.
Margin and markup are not the same
If you set prices by adding a percentage to cost, you are using markup, and the result is a smaller margin than the markup figure. Margin is profit divided by price, so a 25% markup gives a 20% margin.
This is general information, not accounting advice. Check with your accountant if you need to match how your statements classify costs.
Next step
Write down your definition of direct cost on one page. Then compute gross margin for last quarter using it, and again for the quarter before, so you have two numbers to compare.
Keep reading
- What to include on an invoice: a checklistA checklist of required, helpful and optional invoice fields, with a worked example showing how line items, tax and totals fit together.
- Expense tracking for agencies: simple categories and a monthly reviewTen starter expense categories, a 30-minute monthly review checklist and a worked subscription audit, so you see where money goes before it becomes a surprise.
- How to find out which clients and projects are really profitableRevenue is not profit. A four-step method to allocate labour, direct costs and overhead to each client, with a three-client example computed line by line.
In HireOrSell
Ready to run it all in one place?
Projects, clients, time tracking and invoicing in one platform.