Marta Solé is a software engineer in Zaragoza and works as an autónomo (self-employed). In 2025 she invoiced 48,000 € in total. One of her clients, a company in a country outside the European Union with which she signed a project worth 10,000 €, paid her only 8,500 €: the payment slip showed 1,500 € withheld "for non-resident income tax" in that country. Marta has declared the full 48,000 € in Spain, because she is resident here and is taxed on everything she earns worldwide. Her question is simple: has she lost those 1,500 €, or can she get them back?
The short answer is that, in most cases, they can be deducted in the income tax return, but not always in full, and sometimes the right route is to claim them from the other country.
The mechanism: a deduction with two caps
Article 80 of Law 35/2006 on IRPF, Spanish personal income tax, governs the deduction for international double taxation. When your income includes earnings obtained and taxed abroad, you deduct the lower of two amounts:
- The amount actually paid abroad in a tax identical or similar to IRPF or to non-resident income tax.
- The result of applying your effective average tax rate to the part of the taxable base taxed abroad.
According to section 2 of that article, the effective average rate is calculated by dividing the total net tax liability by the taxable base and multiplying by a hundred, to two decimal places, keeping the general base separate from the savings base. The earnings of a self-employed person go into the general base.
Put another way: Spain deducts what you paid abroad, but never more than that same income pays here. If the other country withheld more than Spain charges on that income, the excess is not offset in your Spanish return.
Marta's calculation, step by step
Suppose these figures from her 2025 return, which we use only to illustrate the calculation:
- Business income: 48,000 €. Deductible expenses: 8,000 €. Net earnings: 40,000 €.
- After reductions and personal allowances, general taxable base: 38,000 €.
- Total net tax liability (state plus regional): 8,740 €.
- Effective average rate: 8,740 ÷ 38,000 × 100 = 23.00 %.
- Part of the base taxed abroad. The project brought in 10,000 € of income; if we allocate to it the proportional share of expenses (8,000 × 10,000 ÷ 48,000 = 1,666.67 €), the net earnings from that invoice are 8,333.33 €.
- Cap at the average rate: 8,333.33 × 23 % = 1,916.67 €.
- Tax actually paid abroad: 1,500 €.
- Deduction: the lower of the two, 1,500 €. Marta recovers the whole amount withheld in her return.
Now let us change one figure: suppose the client had withheld 2,500 €.
- Cap at the average rate: still 1,916.67 €.
- Deduction: 1,916.67 €. The remaining 583.33 € are not deducted in Spain.
| Scenario | Withheld abroad | Cap at average rate | Deduction in Spain | Not offset |
|---|---|---|---|---|
| Withholding of 1,500 € | 1,500.00 € | 1,916.67 € | 1,500.00 € | 0 € |
| Withholding of 2,500 € | 2,500.00 € | 1,916.67 € | 1,916.67 € | 583.33 € |
The allocation of expenses in step 5 is not a detail: if few expenses are allocated to the foreign income, the cap goes up; if many are, it goes down. There has to be a reasonable, documented method, because it is one of the points reviewed when the deduction is significant.
When the sensible thing is to claim from the other country
The fact that the other country withheld tax does not mean it was entitled to. If there is a treaty to avoid double taxation between Spain and that country, the treaty decides who may tax each item of income. In the treaties Spain has signed, the profits of a business or professional activity carried on by a resident of Spain are usually reserved to Spain unless the activity is carried on in the other country through a permanent establishment or a fixed base. Each treaty has its own wording and you have to read the one that applies.
If the treaty did not allow the other country to withhold, or only allowed it to withhold less, the tax charged in excess is not a tax that Spain has to offset. There is a risk that the tax authorities will limit the deduction to what the treaty allowed the other state. Whatever is left over can only be recovered by claiming a refund at source. How that claim is made there, on which form and within what deadline, is confirmed by the client's adviser in that country; we do not give opinions on foreign law or promise to handle it through third parties.
If you deduct in Spain a withholding that the treaty did not allow and Hacienda, as the Spanish tax office is commonly known, rejects it years later, you will face an adjustment here and, on top of that, the deadline for claiming it in the other country may have passed. Before including the deduction, it is worth checking what the treaty says about that type of income and whether the client applied its country's general rate or the reduced treaty rate.
What you need to keep
The deduction requires proof that the tax was paid. A bank statement showing a smaller payment is not enough. What helps is:
- The withholding certificate issued by the payer or by the other country's tax authority, or whatever equivalent document exists there.
- The full invoice, which shows that the base was 10,000 € and not 8,500 €.
- The contract, to establish what service was provided and where.
- If you asked for the treaty to be applied at source, a copy of the tax residence certificate you handed over.
A frequent mistake is to declare in Spain only what was received, 8,500 €. That leaves out of the base 1,500 € that really are your income, and at the same time prevents the deduction from being applied, because you cannot deduct a tax on income you have not declared.
The order of things
If your client has not paid you yet, the best moment to avoid the problem is before the first invoice: ask whether it is going to withhold, at what rate and what document it needs to apply the treaty. Many payers ask for a residence certificate or a form of their own; in the case of the United States it is the W-8BEN, which we explain in I have been asked for a W-8BEN. If the withholding has already been made, the calculation above tells you how much you recover in Spain and how much you would have to pursue abroad.
You can send us the withholding certificates and the contract through the form for self-employed people with international clients so that we can calculate the deduction with your figures. The guide to the deduction for international double taxation covers dividends, interest and rents, which follow the same article with other particularities.
How foreign withholding, payments on account and the other obligations of people who invoice abroad fit together is explained on the Salama Tax page for self-employed people with international clients.