Capital Gains Tax on Selling Property in Spain: How It Is Calculated and How to Reduce It

When you sell a Spanish property, the gain on the sale is subject to capital gains tax. For non-resident sellers, the tax is collected through the Non-Resident Income Tax (IRNR) at a flat rate of 19% (for EU/EEA residents) or 24% (for other foreign residents, subject to tax treaty modifications). For resident sellers, the tax is part of the IRPF and is calculated on the savings tax scale (19% to 28%, progressive). The buyer is required to retain 3% of the gross sale price as an advance payment of the seller’s tax. This article explains how the capital gain is calculated, what expenses can be deducted to reduce the gain, how the 3% retention works, the exemptions available (reinvestment in another habitual home, age over 65), and the procedural steps for filing and paying the tax. A dedicated Spanish real estate lawyer coordinates the sale and the tax aspects.

Salama Legal SLP

6/19/20266 min read

Salama Legal SLP
Salama Legal SLP

How the capital gain is calculated

The capital gain on a sale of Spanish property is calculated as the difference between the transmission value (the sale price net of selling costs) and the acquisition value (the original purchase price plus acquisition costs and improvements). The components of each value are specifically defined in Spanish tax law and proper documentation is essential.

Selling costs that reduce the transmission value include: real estate agent commission; notary fees for the sale deed; lawyer fees; gestoría fees; mortgage cancellation costs; municipal plusvalía (if paid by the seller). Acquisition costs that increase the acquisition value include: ITP or VAT paid on the original purchase; notary and registry fees for the original purchase; legal fees for the original purchase; subsequent capital improvements (not maintenance) properly documented.

The step-up basis for inherited properties

For inherited properties, the acquisition value for the capital gain calculation is the value declared in the inheritance (used for inheritance tax purposes), not the value at which the deceased originally acquired the property. This step-up basis is favourable to the heirs because it eliminates any capital gain accrued during the deceased’s lifetime. The detail is explained in our partner-site guide on selling inherited property in Spain.

The step-up basis creates a trade-off at the time of inheritance: declaring a high value for inheritance tax purposes increases the inheritance tax (or makes more of the regional reduction usable) but reduces the future capital gains tax. For families benefiting from the Andalusian 99% reduction in inheritance tax, the optimal strategy is usually to declare the property at the full market value (or the regional reference value, whichever is higher), paying almost no inheritance tax and enjoying a high step-up basis for the eventual sale.

The 3% retention by the buyer

When a non-resident sells a Spanish property, the buyer is legally required to retain 3% of the gross sale price and pay it to the Spanish tax authority within 30 days of the purchase. This retention is an advance payment of the seller’s capital gains tax. The buyer files Model 211 to make the retention and provides the seller with a receipt (Model 211 certified copy) that the seller uses to claim credit against the final tax liability.

The retention is the buyer’s legal responsibility, and the buyer becomes personally liable for the tax if the retention is not made. Non-resident sellers should ensure that the retention is properly made and that they receive the Model 211 receipt at closing. This receipt is essential for the seller’s subsequent IRNR filing within 3 months of the sale.

Filing the IRNR return for the sale

After the sale, the non-resident seller files an IRNR return (Model 210) within 3 months. The return calculates the actual capital gains tax liability based on the calculated gain and the applicable rate (19% for EU/EEA residents, 24% for others). The Model 210 also reports the 3% retention made by the buyer, which is credited against the calculated tax liability.

If the actual tax is less than the 3% retention (typical for sales with modest gain), the seller is entitled to a refund of the difference. The refund typically takes 6-12 months to process from the filing of the Model 210. If the actual tax is more than the retention, the seller pays the difference at the time of filing. The lawyer prepares the Model 210 and ensures that all relevant deductions are properly claimed.

The reinvestment exemption

The reinvestment exemption applies to sales of the seller’s habitual home (vivienda habitual) when the proceeds are reinvested in another habitual home within 2 years. The exemption is total if the full proceeds are reinvested, and proportional if only part is reinvested. The exemption is available to both Spanish residents and EU/EEA residents who can prove that the property sold was their habitual home (continuous residence for at least 3 years before the sale). The Spanish-side mechanics are similar to the ones described in our partner-site article on the complete reinvestment exemption guide.

For non-resident sellers of a property that was not their habitual home (most cases for international buyers of holiday or investment properties), the reinvestment exemption is not available, and the full capital gain is subject to tax. The exemption is therefore not a relevant planning tool for typical international purchase-sale transactions of non-habitual residences.

The over-65 exemption

Spanish sellers aged 65 or more who sell their habitual home benefit from a total exemption of the capital gain from IRPF, without the requirement to reinvest. This exemption applies to residents and is the most favourable treatment available for sales of habitual home by older residents. For non-residents over 65, the exemption is not generally available, although the analysis depends on the specific tax treaty applicable.

A complementary mechanism for residents over 65 is the lifetime annuity exemption (artículo 38.3 LIRPF), which exempts the capital gain on the sale of any asset (not just the habitual home) if the proceeds are used to constitute a lifetime annuity within 6 months, with a maximum of €240,000 per year. This mechanism can be useful for older residents who sell investment properties and want to convert the proceeds into a guaranteed income stream.

Municipal plusvalía at sale

The plusvalía municipal is a town-hall tax on the increase in the value of the land (not the building) between two transmissions. The tax applies on the sale and is calculated on the increase in cadastral value during the seller’s holding period. Since the constitutional court reform of 2021 (Royal Decree-Law 26/2021), the seller can choose between the objective method (based on cadastral values and multipliers) and the real-gain method (based on the actual increase in land value).

For non-resident sellers, the plusvalía is the buyer’s legal responsibility because the town hall cannot easily enforce against a non-resident. The buyer retains the plusvalía amount from the sale price and pays it to the town hall directly. The standard practice is for the lawyer to coordinate the calculation and payment of the plusvalía to ensure that the correct amount is retained and paid.

Strategies to reduce the capital gain

Several strategies can reduce the capital gain on a sale: thorough documentation of all acquisition costs to maximise the acquisition value; documentation of all capital improvements (not maintenance) during the holding period to add to the acquisition value; selection of the optimal valuation methodology for the plusvalía (objective vs. real-gain); for residents over 65, consideration of the over-65 exemption or the lifetime annuity mechanism.

A strategy that does not work is undervaluing the sale price in the deed to reduce the apparent gain. The Spanish tax authority cross-checks the sale price against the regional reference value and against market comparables, and undervaluation leads to a complementary tax assessment within the 4-year prescription period. The complementary assessment includes interest and penalties and is much worse than the original tax would have been.

Coordination with the home-country tax

The capital gain on a Spanish property sale may also be taxable in the seller’s home country, depending on the tax treaty applicable. UK residents pay UK capital gains tax on Spanish property sales (with credit for Spanish tax paid under the unilateral relief in TCGA 1992). US residents report the gain on their US tax return (with credit for Spanish tax paid under Internal Revenue Code section 901). German residents declare the gain in their Anlage SO (with credit for Spanish tax under the Spain-Germany double tax treaty).

The coordination of the Spanish and home-country tax filings requires professional advice on both sides. The Spanish lawyer typically handles the Spanish-side filing; the home-country accountant handles the home-country filing. The two professionals must communicate to ensure consistent treatment of the gain and proper claim of the foreign tax credit.

Action steps for a sale

First: engage a Spanish real estate lawyer at the start of the sale process. Second: gather all the documentation supporting the acquisition value (original purchase deed, ITP/VAT receipts, notary and registry receipts, improvement invoices). Third: negotiate the sale and prepare the public deed with proper documentation of the selling costs. Fourth: at closing, ensure that the 3% retention is properly made by the buyer. Fifth: within 3 months of the sale, file the Model 210 IRNR return with the lawyer’s preparation. Sixth: coordinate with the home-country accountant for the home-country filing and credit claim. For a full consultation on a property sale, contact our team.

The capital gains tax on a Spanish property sale is a substantial cost that can be optimised with proper planning and documentation. The investment in professional guidance is the best way to ensure that all deductions are properly claimed and that the tax is paid correctly on both sides of the transaction.