How to Calculate Payroll (Step by Step)
Payroll is gross pay, minus pre-tax deductions, minus tax, minus post-tax deductions. Here is the order, a worked example, and why sequence changes the answer.
Payroll looks intimidating because it bundles several small calculations into one number. It is much easier once you see that it is a sequence, and that the sequence has to run in a specific order. Get the order wrong and the tax comes out wrong, even when every individual figure is right.
The four steps, in order
- Work out gross pay for the period.
- Subtract pre-tax deductions to get taxable pay.
- Calculate tax on that taxable pay.
- Subtract tax and any post-tax deductions to get net pay.
That is the whole model. Everything else is detail about what belongs in each bucket.
Step 1: gross pay
Gross pay is everything the employee earned this period, not just their base salary. Include base salary or hourly pay for hours worked, overtime, bonuses or commission, and allowances such as housing, medical, or transport.
If overtime is part of the picture, our guide on how to calculate overtime pay covers the multiplier maths. To total the hours themselves, including breaks and overnight shifts, use the hours calculator.
Step 2: pre-tax deductions (this is where order matters)
Pre-tax deductions come out of gross pay before tax is calculated, which lowers the taxable amount. Typical examples are retirement or provident fund contributions and some insurance premiums.
This is the step people get wrong. If you calculate tax on the full gross and subtract the provident fund afterwards, you tax money that was never taxable, and the net pay comes out too low. Pre-tax items reduce the base that tax is charged on. Our guide on what a provident fund is explains how those contributions work.
Step 3 and 4: tax, then post-tax deductions
Calculate tax on the taxable pay from step 2, using whatever rates and thresholds apply where you are. Then subtract the tax, plus any post-tax deductions such as loan repayments, salary advances, or union dues, which come out of what is left rather than reducing the tax.
What remains is net pay: the amount that actually reaches the employee's account. Our guide on gross vs net salary looks at the same journey from the employee's side.
A worked example
Base 60,000, plus 8,000 overtime, plus 12,000 allowances:
- Gross pay = 60,000 + 8,000 + 12,000 = 80,000
- Pre-tax: provident fund at 12% of base = 7,200. Taxable pay = 80,000 − 7,200 = 72,800
- Tax at an assumed 10% of taxable pay = 7,280
- Post-tax: loan repayment = 3,000
- Net pay = 72,800 − 7,280 − 3,000 = 62,520
Notice what the pre-tax step did: taxing the full 80,000 instead would have cost 8,000 in tax rather than 7,280. Same inputs, wrong order, worse answer.
Do not forget employer cost
Gross pay is what the employee earns, not what the employer spends. Employers usually also pay their own contributions on top, most commonly a matching provident fund contribution. In the example above, a matching 12% adds another 7,200 of employer cost, so an 80,000 gross employee costs roughly 87,200. That total is often called cost to company.
Calculate it without the spreadsheet
The payroll calculator runs these steps in the right order and shows gross, taxable pay, tax, deductions, net pay, and employer cost together. Every rate is editable, and it runs entirely in your browser, so salary figures are never uploaded anywhere.
One honest caveat: tax rates, thresholds, and contribution rules differ by country and change over time. No calculator can know your local law, so treat any defaults as a starting point, enter the rates that actually apply to you, and check with your finance team or a local accountant for anything official.