PUNTO HABITAT · A guide for property owners
Costs and taxes when selling or buying a flat in Barcelona
How much will you have left after selling? Start by separating taxes, transaction costs and any outstanding mortgage. This guide covers each item, with a worked example and a summary for buyers and sellers.

01 · Costs for each party
What does the seller pay, and what does the buyer pay?
In a typical sale between private individuals, the seller needs to budget for Spanish personal income tax (IRPF) on the gain, municipal land value tax (plusvalía municipal) and their selling costs. The buyer pays the applicable purchase tax and the costs they are responsible for when buying.
There is no single percentage that tells you how much it costs to sell any flat. Two properties sold for the same price can produce very different tax bills.
| Item | Who usually pays |
|---|---|
| IRPF on the capital gain | A seller who is tax resident in Spain, where there is a taxable gain. |
| Municipal land value tax (plusvalía municipal) | The seller; some transactions fall outside the tax or qualify for an exemption. |
| Property transfer tax (ITP) on a resale home | The buyer. |
| VAT and stamp duty (AJD) on the first supply of a new home | The buyer, depending on the transaction and any applicable tax relief. |
| Purchase deed and registration | Generally the buyer in Catalonia, unless otherwise agreed or provided for by a specific rule. |
| Estate agency fees | According to the services and terms each party has agreed to. |
| Discharging the seller’s mortgage | The seller: repayment of their debt and the costs of discharging their mortgage, in the sale free of charges described in this guide. |
The allocation of deed costs in Catalonia is set out in Article 531-6 of the Civil Code of Catalonia. Taxes follow their own rules.
02 · If you are selling
The costs of selling a flat in Barcelona
IRPF: it is the gain that is taxed
For an individual who is tax resident in Spain, a sale can give rise to a capital gain or loss. The gain from an ordinary property sale forms part of the savings tax base.
The disposal value is compared with the acquisition value, with any applicable tax adjustments. Keep your deeds and invoices: they can affect the result.
- Acquisition: the purchase price is increased by the costs and taxes you paid on that acquisition, such as ITP or VAT, notary and Land Registry fees, and any improvements you can substantiate. This increases the acquisition value and reduces the gain. Loan interest is not included.
- Disposal: the selling price is reduced by costs and taxes deductible when calculating the gain, such as estate agency fees and municipal land value tax you have paid. They must relate to the sale and be supported by documentation.
- If the property was rented out: depreciation that must be taken into account for tax purposes needs to be reviewed. Repairs and improvements also receive different treatment.
See: AEAT: rules for calculating a capital gain.
| Band of taxable savings income | Rate |
|---|---|
| Up to €6,000 | 19% |
| €6,000 to €50,000 | 21% |
| €50,000 to €200,000 | 23% |
| €200,000 to €300,000 | 27% |
| Over €300,000 | 30% |
Each rate applies only to its band. The final tax liability also depends on other savings income, offsets and adjustments in the tax return.
See: Personal Income Tax Act, Articles 66 and 76.
Municipal land value tax: a separate calculation
This local tax charges the increase in the value of urban land. It has its own calculation, separate from IRPF. If you can demonstrate that there has been no increase under its rules, the transaction is not subject to this tax, but you must still report it and provide the documentation.
For an ordinary property sale, you have 30 working days from the transfer to submit the applicable self-assessment or tax declaration.
Find out how to calculate municipal land value tax in Barcelona.
See: Barcelona City Council: municipal land value tax.
Fees and preparing the property for sale
Review your agency agreement: which services it includes, the fees and when they become payable. Add any work you commission separately, such as repairs, house clearance or removals.
Also check the occupancy certificate (cédula de habitabilidad) and energy performance certificate. At PUNTO HABITAT, we cover their renewal if they have expired when you sell with us.
Outstanding mortgage and removal from the Land Registry
In a sale free of charges, the seller is responsible for discharging their mortgage. If a balance remains, they can repay it beforehand from savings or arrange for it to be repaid on completion using part of the sale proceeds. The payment arrangements need to be prepared for each transaction.
It helps to distinguish two things: repaying the loan principal and paying the mortgage discharge costs. The principal repaid is neither a tax nor a deductible expense when calculating the gain for IRPF.
Removing the mortgage from the Land Registry can involve notary and registration fees, plus administrative agency fees if you appoint one to handle the process. The loan may also provide for an early repayment charge, within the applicable limits. Ask the bank for the outstanding balance on your chosen date and arrange the registry discharge: paying off the loan does not itself remove the mortgage entry.
This guide covers sales free of charges. A buyer taking over the mortgage requires a specific agreement and the bank’s consent to release the seller from their debt. Mortgage Act, Article 118.
IBI, community charges and other bills
Review the annual property tax (IBI), the certificate of outstanding owners’ association debts, special assessments and utilities. Before signing, record in writing how bills will be shared and which amounts remain outstanding.
03 · Your circumstances matter too
Can you reduce the IRPF due on your sale?
You are over 65 and selling your main residence
The gain is exempt from IRPF if you are over 65 and sell your main residence as defined for tax purposes. You do not need to reinvest the money or buy another home. This main-residence exemption does not apply to the sale of a second home.
For this purpose, the property may qualify as your main residence if it is your main home when sold or was your main home at any point during the previous two years. Where there are several owners, each person’s position is assessed separately. Ownership and the main-residence requirements must be checked.
You are selling to buy another main residence
The gain may be exempt if you reinvest the amount required by the rules in another main residence. You can buy the new home up to two years before selling the previous one, or up to two years afterwards. The period is measured from date to date.
For example, if you bought your new main residence on 15 March 2025 and sell the previous one on 15 February 2027, the purchase falls within the two years before the sale.
A full exemption requires reinvestment of the entire required amount; if reinvestment is partial, the exemption is proportionate. Both properties must meet the main-residence requirements.
04 · A step-by-step example
If you sell for €400,000, how much is left?
Imagine a sole owner who is tax resident in Spain. They bought their home for €270,000, paid €20,000 in purchase costs and taxes that form part of the acquisition value, and are now selling it for €400,000.
In this example, selling costs deductible when calculating the gain total €10,000, including municipal land value tax. These are illustrative figures, not a quotation for services.
First: the taxable gain
- Selling price
- €400,000
- Less deductible selling costs
- −€10,000
- Less purchase price
- −€270,000
- Less purchase costs and taxes
- −€20,000
Capital gain in this example
€100,000This example assumes no previous letting, improvements, exemptions, other savings income, offsets or other adjustments. Applying the tax bands: 6,000 × 19% + 44,000 × 21% + 50,000 × 23% = €21,880 in IRPF.
Next: the net sale proceeds
For this calculation, we assume that the owner has no outstanding mortgage debt. We deduct selling costs from the price and set aside the calculated IRPF.
- Price paid by the buyer
- €400,000
- Selling costs, including municipal land value tax
- −€10,000
- Amount set aside for IRPF in this example
- −€21,880
Net proceeds after these costs and taxes
€368,120Municipal land value tax is already included in the €10,000 of costs. If you have an outstanding mortgage, its repayment is calculated separately according to how and when you plan to repay it. Add any other costs specific to your transaction.
These are the figures worth knowing before committing to your next home purchase. The taxable gain and the money left in your account answer different questions.
05 · If you are also buying
Taxes paid by the buyer in Catalonia
Resale homes: property transfer tax
An ordinary purchase of a resale home is subject to property transfer tax (ITP). Catalonia’s general scale is progressive:
| Portion of the taxable amount | Rate |
|---|---|
| Up to €600,000 | 10% |
| €600,000 to €900,000 | 11% |
| €900,000 to €1,500,000 | 12% |
| Over €1,500,000 | 13% |
If the taxable amount is €400,000 and the general scale applies, ITP is €40,000. For a taxable amount of €700,000, the calculation is €60,000 on the first €600,000 and €11,000 on the remainder: €71,000 in total.
Reduced rates and relief are available subject to conditions. A 20% rate applies to certain purchases by large property holders or acquisitions of entire residential buildings, with exceptions. Buying through a company does not, by itself, trigger the 20% rate.
See: ATC: property transfer tax scales and rates.
See: ATC: taxable amount and reference value.
New homes: VAT and stamp duty
On the first supply of a new home by the developer, the usual tax is 10% VAT plus the applicable stamp duty (AJD). In Catalonia, the general AJD rate for transfers subject to VAT is 1.5%.
Special cases and tax relief may apply. The 4% VAT rate is reserved for officially protected housing under the special scheme or public promotion; it does not apply to all protected housing.
See: AEAT: VAT or ITP when buying a home and ATC: notarised documents and stamp duty.
Notary, Land Registry and financing
Add the purchase costs you are responsible for and administrative agency fees if you appoint one. If you apply for a mortgage, distinguish the purchase costs from the loan costs.
For loans governed by Act 5/2019, the lender pays the administrative agency fees, the notary’s fees for the mortgage deed and the registration of the mortgage security; the borrower pays for the valuation. Copies are paid for by whoever requests them. The lender is responsible for AJD on the creation of the mortgage loan.
See: Real Estate Credit Agreements Act, Article 14 and ATC: who pays stamp duty on a mortgage.
06 · Common questions
What sellers often ask us
Do I pay IRPF on the full selling price?
No. In an ordinary sale, IRPF is calculated on the capital gain: the disposal value, after deducting eligible selling costs and taxes, is compared with the acquisition value, which includes purchase costs and taxes. If the property was rented out or improvements were made, the relevant adjustments must also be applied. AEAT information on property sales.
Are municipal land value tax and IRPF the same?
No. Municipal land value tax charges the increase in the value of urban land and is handled by the city council. For individuals who are tax resident in Spain, IRPF taxes the gain on the sale under its own rules. Exemption from one does not imply exemption from the other.
Who discharges the mortgage, and how is it paid?
In a sale free of charges, the seller is responsible for discharging their mortgage. They may have repaid the loan beforehand from savings or arrange to repay it using part of the sale proceeds on signing. The documentation and payment arrangements are prepared according to the particular circumstances.
Does repaying the mortgage loan reduce the gain for IRPF?
No. The principal you repay to the bank is not deductible when calculating that gain, whether you pay it from savings or from the sale proceeds. A different rule applies to the outstanding principal of the loan used to buy the property being sold when claiming the reinvestment exemption for another main residence: it affects the amount that must be reinvested, not the calculation of the gain.
Am I exempt from IRPF if I am over 65?
The gain from selling your main residence, as defined for tax purposes, is exempt, and you do not need to buy another home. Being over 65 does not make the sale of any second home exempt under this provision. Where there are several owners, the exemption is assessed for each person’s share. AEAT requirements.
Can I buy first and sell later to claim the reinvestment exemption?
Yes. You can buy the new main residence within the two years before selling the previous one, as well as within the two years afterwards. The period is measured from date to date, and the main-residence and reinvestment-amount requirements must be met. Reinvestment time limits and conditions.
What if I sell a flat I inherited?
Inheritance and the subsequent sale are separate transactions. For IRPF on the sale, the acquisition value is determined under the Inheritance Tax rules, capped at market value, and adjusted for the applicable costs, taxes and other items. You also need to review municipal land value tax on the sale and whether selling affects any tax relief claimed on inheritance.
What if I am not tax resident in Spain?
The gain is assessed under Non-Resident Income Tax (IRNR), not IRPF. In the usual case of a sale by a non-resident without a permanent establishment, the buyer withholds 3% of the consideration attributable to the non-resident seller and pays it to the tax authority as a payment on account of the seller’s tax. It is neither the final tax liability nor an extra cost for the buyer. AEAT guidance.
When should I work out the expected costs?
Before accepting an offer and, especially, before committing to buying another home. Gather the acquisition deed, supporting documents for costs and taxes, the IBI bill and, if there is a mortgage, its current balance and your plan for discharging it.
Continue preparing your sale
The information you need at every step.
Select the guide you would like to read.