You sell a flat, some shares or some crypto and the Tax Agency wants its share. How much depends on where the transaction fits, not just how much you've made.
Article 33.1 of the Personal Income Tax Law defines it as any change in the value of your assets that becomes apparent when the make-up of those assets changes. In plain terms: you had something, you've transferred it and now it's worth something else. That difference is what gets taxed.
The formula
Transfer valueSale price minus costs and taxes borne by the seller
−
Acquisition valuePurchase price plus investments, improvements, costs and taxes, minus depreciation if it was rented out
=
Gain or lossWhat actually goes into your tax return
The most expensive mistake is estimating the gain by eye, subtracting the purchase price from the sale price. Notary and registry fees, transfer tax or VAT on the purchase, the estate agent's commission and genuine improvements all add to the acquisition value and reduce the gain. The depreciation you deducted while the property was rented out, on the other hand, increases it.
Where it usually comes up
Real estate
Home, premises, garage or land. You can add everything it cost to buy and improve it to the acquisition value, but you must subtract the depreciation deducted if it was rented out.
Key: the municipal capital gains tax (plusvalía) is a separate tax
Shares and funds
For identical securities the FIFO rule applies: you are deemed to sell first the ones you bought first. Switches between investment funds let you defer tax.
Key: switching funds isn't taxed, redeeming them is
Cryptocurrencies
FIFO too. And watch out: swapping one crypto for another is an exchange and creates a gain even if you haven't seen a euro. If you hold them on exchanges outside Spain, there may be a reporting obligation.
Key: crypto-to-crypto is already taxable
Collections and art
Artworks, jewellery, watches, wine, classic cars. They are taxed like any other disposal, but the difficulty lies in proving the acquisition value when the purchase was twenty years ago.
Key: no invoice, no cost to deduct
Vehicles and personal belongings
They are usually sold for less than they cost. That loss cannot be counted: the law treats it as consumption, not a capital loss. If, exceptionally, there is a gain, it is taxed.
Key: art. 33.5.b — loss due to consumption
Other assets and rights
Licences, unlisted shares, lease assignment rights, compensation, expropriations. Each has its own valuation rule and it's worth reviewing before you sign.
Key: specific valuation rules
The question that changes everything
General or savings tax base: where does it go?
The same amount of money can be taxed at 19% or at 47%. The difference isn't the amount, it's whether or not the gain comes from transferring something.
Savings tax base
When there is a transfer
You sell, swap, give away or transfer an asset. This is the usual case: property, shares, funds, crypto, art.
Rates from 19% to 30%, the same throughout Spain
It isn't added to your salary or business income
Your region doesn't change the rate
General tax base
When there is no transfer
Your wealth increases without you having transferred anything: prizes, grants, public subsidies, non-exempt compensation.
It is added to the rest of your income and taxed at your marginal rate
Between 45% and 54% in the top bracket depending on the region
Here where you live matters a lot
Savings taxable base scale
In force since 01/01/2025 · Law 7/2024
Savings taxable baseApplicable 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%
The scale is progressive by bracket: a 60.000 € gain isn't all taxed at 23%, but 6.000 € at 19%, 44.000 € at 21% and the remaining 10.000 € at 23%. The top bracket rose from 28% to 30% under Law 7/2024.
Second question
Are you selling as an individual or as part of a business activity?
If you buy and sell regularly and in an organised way —property development, repeatedly buying and selling flats, professional trading—, the Tax Agency may consider that you are not earning a capital gain but business income. And that changes everything.
As an individual
Capital gain
Savings tax base, 19% – 30%
No VAT or business registration (IAE)
No bookkeeping obligations
Within a business activity
Business income
General tax base, marginal rate
Possible VAT and business registration (IAE)
Formal and invoicing obligations
What almost nobody takes advantage of
Losses count too
If this year you made money on some shares and lost on others, you aren't taxed on the gross gain. There is a legal order for offsetting that is worth planning before 31 December.
1
Gains against losses in the same tax year
First, all the capital gains and losses of the year are offset against each other within the savings tax base.
2
The negative balance, against investment income
If there is still a loss left, it can be offset against dividends and interest from the same year, but only up to 25% of their positive balance.
3
Whatever is left, over the next 4 years
The rest isn't lost: it is carried forward to the next four tax years and applied in the same order.
Beware of buying back. If you sell at a loss and buy back the same security within the two months before or after (listed securities), one year (unlisted securities) or one year after (other assets), the loss is not counted in that tax year. It isn't lost; it is deferred until you finally dispose of it.
How it affects personal income tax
Common cases, one by one
The transactions we see most at the firm and what to check in each before assuming how they are taxed.
Transaction
Taxed
Base
The key
Property sale
Yes
Savings
Add costs, taxes and improvements to the cost; subtract depreciation if it was rented out. The municipal capital gains tax is separate.
Shares and funds
Yes
Savings
FIFO rule for identical securities. Switching between funds defers tax; redeeming doesn't.
Cryptocurrencies
Yes
Savings
FIFO, and crypto–crypto swaps already create a gain. If they are held abroad there may be a reporting obligation.
Collections and art
Yes
Savings
Everything depends on being able to prove the acquisition value. Without documents, the cost the Tax Agency accepts is zero.
Private vehicle
Only if there is a gain
Savings
The usual loss cannot be counted: art. 33.5.b treats it as consumption. A gain, if there is one, is taxed.
Grants and subsidies
Yes
General
There is no transfer, so they go to the general tax base and are taxed at your marginal rate. Some have a specific exemption.
Prizes
Yes
General
State lotteries and betting, ONCE and the Red Cross have a special 20% tax on the amount above 40.000 €. The rest goes to the general tax base.
Indicative table. Each transaction has nuances —dates, ownership, marital property regime, tax residency— that can completely change the result.
Before you resign yourself to paying
What can bring the bill to zero
The law provides for cases where the gain exists but is not taxed. Almost all require meeting conditions at the time of the transaction, not afterwards.
01
Reinvestment in your main home
If you sell your main home and reinvest the proceeds in buying another, the gain is exempt for the part reinvested. There is a deadline, and you must prove that both really are your main home.
Art. 38.1 LIRPF02
Over 65s
The sale of the main home by people over 65 is exempt, with no need to reinvest. And for other assets, the exemption covers the amount reinvested in an insured life annuity, up to a maximum of 240.000 €.
Art. 33.4.b and 38.3 LIRPF03
Abatement coefficients
For assets acquired before 31/12/1994 and not used in a business, part of the gain can be reduced —only the part generated up to 20/01/2006— with a cumulative cap of 400.000 € of transfer value per taxpayer since 2015.