The retención is an advance on a tax nobody has calculated yet
In most countries our readers come from, the tax deducted from your salary is the tax. Spain does not work like that. The retención a cuenta is a down payment on a bill nobody has worked out yet, and the real one arrives with the annual return you file the following June. Withhold too much, and Hacienda transfers the excess back. Too little, and you pay the rest yourself.
So the percentage above is not the Spanish tax on your salary. That is a separate calculation on different scales, and it lives on the annual IRPF calculator. A low withholding is not a win either. It is a debt with a due date.
Your family situation sets the percentage
The rate is worked out for you, not for your salary. The algorithm strips your social security contributions out of the year’s expected gross, along with an employment expense allowance of €2,000 and the reduction for low employment income. It taxes what is left, then credits back the tax on your personal and family minimum: €5,550 for yourself, €2,400 for a first child, €2,700 for a second, and €2,800 more for each child under three. More than two children takes another €600 off the base.
So the person at the next desk, same gross, one child and a spouse without income, keeps more of every payslip than you do. Same law, different family.
There is a floor to all this. Below a threshold set by family situation and children, €15,876 for a single person with none, nothing is withheld at all. Just above it the rate cannot bite hard: up to €35,200 of gross, the year’s withholding is capped at 43% of the pay above that threshold.
Contract type lands here too. We assume an open-ended contract, with unemployment at 1.55%; a fixed-term one contributes slightly more. The official algorithm also sets floor rates for contracts of under a year and for special employment relationships, which we do not apply. On a short contract your real retención can run higher than the figure above.
Your region changes nothing on the payslip
Withholding uses one national scale, 19% to 47%, and your employer applies it identically in Madrid and in Catalonia. The community shows up later, when the annual return stacks its scale on top of the state one, which starts at 9.5%. Moving between communities changes what you settle in June, not what leaves your payslip in March.
This number is checked against AEAT’s own service
The Agencia Tributaria runs its own withholding service, and we ran our engine against it: seventeen cases (single filers, a non-earning spouse, children, a child under three, shared custody, the exemption threshold, the cap) all matching to the cent, down to the truncation quirk that leaves the withheld amount marginally below the exact quota. Those cases are our test suite; they break the build if the engine drifts. How we calculate has the rest.
Where the advance and the real tax come apart
The advance fits one person: one employer, one full year, salary as the only income. Change any of that and June has something to say.
- Two employers in one year. Each sets a rate on the pay it alone gives you, as if that were your whole income, so part of your salary sits in brackets that are too low. Added together in the return, the real tax exceeds both advances, and you pay the difference.
- A job change mid-year. The new employer starts from what it will pay you in the months that remain, which is less than your annual income, so the rate it applies is gentler.
- Income that is not salary. Freelance work on the side (freelancer calculator), rent, dividends: your employer knows about none of it.
None of this is a payroll mistake. It is what an advance is for.