Employer cost and the salary engine
On top of a salary you pay employer taxes and social contributions that differ by country and change every year. StaffMargin turns a salary into its full employer cost with a country-specific salary engine, so the cost rate behind every margin is built from each country’s actual tax rules.
This page explains the three cost layers, what a payroll rule contains, and how the engine moves between the layers. It models cost. It does not run payroll, produce payslips, or file anything.
The three cost layers
Section titled “The three cost layers”Every salary resolves to three layers, in your salary’s currency.
- Net is take-home pay, after the employee’s own contributions and income tax.
- Gross is pay before the employee’s deductions, the figure on most contracts.
- Employer cost is gross plus the contributions the employer pays on top. This is the true cost, and the number every margin uses.
Two formulas connect them.
employer cost = gross + employer contributions
net = gross − employee contributions − income tax
You enter a salary at whichever layer you have. Most teams enter net, because that is what they agreed with the person. The engine derives the other two.
What a payroll rule contains
Section titled “What a payroll rule contains”A payroll rule is a declarative description of one country’s payroll, effective-dated so last year’s rates and this year’s both exist. It has two parts: contributions and income tax.
Contributions
Section titled “Contributions”Each contribution is one line, on the employee side or the employer side, computed one of three ways:
- Flat: a rate times a base (most social contributions).
- Bands: marginal brackets over the base, like UK National Insurance.
- Schedule: a fixed amount looked up by which band the base falls in, like the Philippine SSS table.
Each contribution sits on a base of either gross, or gross minus the social contributions already taken, and can be clamped by a floor or a cap (so a contribution stops growing above a ceiling). Employee contributions can be marked deductible, which means they lower the income-tax base.
Income tax
Section titled “Income tax”Income tax is progressive: marginal bands over a base of gross, less the deductible employee contributions, less any allowance and standard deduction. The rule also supports a rebate that zeroes the tax below a threshold, and a tax-on-tax surcharge, so systems like India’s cess and 87A rebate are expressed in the rule rather than in code.
How the gross-up works
Section titled “How the gross-up works”Gross is the pivot. Whatever layer you enter, the engine resolves the gross that produces it, then runs the rule forward once to get every layer and every line item.
- Enter gross, and it is used directly.
- Enter net or employer cost, and the engine solves for the gross that yields your figure. For a flat system it is direct. For a progressive one it converges by iteration, because net and employer cost both rise smoothly with gross.
Running the rule forward produces the itemized breakdown: each employee contribution, the income tax, and each employer contribution, which sum to the gap between net and employer cost.
If a salary has no payroll rule, it is a flat figure: net, gross, and employer cost are the same number, and nothing is grossed up. Useful for a contractor you pay a flat amount, or a market you have not modelled yet.
Pay basis, capacity, and partial periods
Section titled “Pay basis, capacity, and partial periods”A salary carries a pay basis: annual, monthly, hourly, daily, or fixed. The engine normalises the entered amount into the rule’s period before the math runs. Annual and monthly convert by a simple factor. Hourly and daily use the rule’s hours-per-period and days-per-period, so an hourly rate annualises correctly.
Two adjustments keep part-time and partial periods honest.
- Capacity (FTE). For hourly and daily pay, the engine scales by the employee’s capacity, their weekly hours over a full-time week. A 20-hour-a-week person on an hourly rate costs half a full-timer. Monthly, annual, and fixed salaries pass through as the actual amount, never prorated by capacity.
- Partial periods. A mid-month start, a leaving date, or unpaid leave prorates every amount in the calculation by the fraction of the period actually worked, while the rates and brackets stay the same.
Country templates and reproducibility
Section titled “Country templates and reproducibility”You do not start from a blank rule. StaffMargin ships prefilled templates for priority markets, including North Macedonia, Bulgaria, Romania, Georgia, and Ukraine. Clone one, adjust the rates, and you have a working rule in minutes. Because the engine is fully declarative, with no per-country code, you can also build a rule for any country yourself from the same contribution and tax parts.
Rules are versioned and immutable once published. When next year’s rates land, you add a new dated version rather than editing the old one. StaffMargin snapshots each salary’s breakdown with the exact rule version it used, so a cost you calculated last year still reads the same today, and it only recomputes when you change the salary or its rule. That is what makes a historical margin reproducible. See multi-currency and historical rates for the same idea applied to exchange rates.
