Have you sold shares, cryptocurrency, real estate or another investment in Spain?
The Finorum Spain Capital Gains Tax Calculator estimates the tax that may apply under Spain’s 2026 personal income tax rules. Enter the acquisition value, sale value and eligible expenses to estimate the taxable capital gain and the corresponding tax.
Spain generally includes gains arising from the disposal of investments in the savings taxable base. Progressive savings tax rates apply regardless of how long an ordinary investment has been held, although important exemptions are available for certain sales of a main residence.
| Purchase price | |
| Sale price | |
| Costs / fees | |
| Gross gain | |
| CGT () | |
| Net profit |
How to Use the Calculator
To estimate your Spanish capital gains tax:
- Select Spain as the country.
- Choose the type of asset sold.
- Enter the acquisition and disposal values.
- Add eligible acquisition and selling expenses.
- Include compatible gains or losses where relevant.
- Select the appropriate tax route or exemption.
- Review the taxable gain and estimated tax.
The standard calculation assumes that the user is an individual tax resident of Spain and that the asset belongs to their private investment portfolio. Business assets, professional trading and non-resident taxation may require a different calculation.
Capital Gains Tax Rates in Spain
Capital gains arising from the transfer of assets are normally included in the Spanish savings taxable base, known as the base imponible del ahorro.
The combined savings tax rates applicable to residents are:
- 19% on the first €6,000
- 21% on the portion from €6,000 to €50,000
- 23% on the portion from €50,000 to €200,000
- 27% on the portion from €200,000 to €300,000
- 30% on the portion exceeding €300,000
These are progressive rates. Each part of the savings taxable base is taxed within its corresponding band rather than the entire gain being charged at the highest rate reached.
Spain’s Tax Agency confirms the current savings-income scale, including the 30% rate above €300,000. Spanish Tax Agency
Example of the Progressive Calculation
Suppose an investor has a net taxable capital gain of €80,000 and no other savings income affecting the calculation.
The estimated tax would be calculated in bands:
- first €6,000 at 19%: €1,140
- next €44,000 at 21%: €9,240
- remaining €30,000 at 23%: €6,900
The estimated capital gains tax would therefore be €17,280.
The effective tax rate on the €80,000 gain would be approximately 21.6%, even though the highest marginal rate reached is 23%.
Dividends, interest and other savings income can affect how much of the gain falls into each tax band.
Selling Shares in Spain
A gain from the sale of shares is generally calculated as:
Capital gain = Disposal value − Acquisition value − Eligible costs
The acquisition value can normally include:
- the original purchase price;
- broker commissions paid on acquisition;
- transaction fees directly related to the purchase;
- certain costs associated with acquiring the shares.
The disposal value is generally the sale proceeds reduced by commissions and other directly related selling expenses paid by the seller.
For listed shares, Spanish tax residents generally use the FIFO method: first in, first out. When identical shares were purchased at different times, the shares acquired first are normally treated as the first ones sold.
This rule can affect both the gain and the availability of capital losses, particularly where the investor has accumulated the same share through several purchases.
Does Spain Have a Holding-Period Exemption for Shares?
Spain does not generally exempt ordinary gains from shares merely because the investment was held for a certain number of years.
A private investor may therefore owe tax on a gain even after holding the shares for 10, 15 or 20 years. The taxable gain is normally included in the savings base and charged at rates between 19% and 30%.
Certain assets acquired before 31 December 1994 may qualify for limited transitional reduction rules. These rules are complex, subject to statutory limits and relevant only to older investments.
The calculator’s standard estimate does not assume that a historic transitional reduction applies unless this is specifically indicated.
Capital Losses and the Repurchase Rule
Capital losses from the sale of shares can generally be offset against compatible capital gains included in the savings taxable base.
However, Spain applies an anti-avoidance rule where identical or homogeneous securities are repurchased around the date of a loss-making sale.
For shares traded on qualifying markets, a loss may be temporarily disallowed when the taxpayer acquires homogeneous shares during the two months before or after the disposal. The suspended loss can normally be recognised when the replacement shares are later sold.
For certain unlisted securities, the relevant repurchase period may be one year rather than two months.
The Spanish Tax Agency confirms that a loss is deferred when homogeneous securities are reacquired within the relevant period. Spanish Tax Agency
Offsetting Gains, Losses and Savings Income
Gains and losses arising from transfers are first netted within their section of the savings taxable base.
When the final result is negative, part of the loss may generally be offset against positive investment income such as:
- dividends;
- interest;
- certain income from savings products;
- other qualifying returns on movable capital.
The cross-category offset is generally limited to 25% of the positive balance in the other savings-income category.
Unused eligible losses can normally be carried forward for up to four years. They should not be treated as freely deductible against salary, self-employment income or unrelated general income.
Accurate annual records are essential because the order and category of the losses can affect their future use.
Cryptocurrency Taxation in Spain
Spanish tax residents generally realise a capital gain or loss when they dispose of cryptocurrency held as a private investment.
A taxable disposal can include:
- selling cryptocurrency for euros or another fiat currency;
- exchanging one cryptocurrency for another;
- using cryptocurrency to purchase goods or services;
- transferring a cryptoasset in return for another asset.
A crypto-to-crypto exchange is not tax-free merely because no euros were received. The Spanish Tax Agency treats an exchange between different virtual currencies as a barter transaction capable of producing a taxable gain or loss.
For a sale into fiat currency, the result is generally:
Capital gain or loss = Disposal value − Acquisition value − Eligible costs
For a crypto-to-crypto exchange, the disposal value is generally determined by reference to the higher relevant market value of the asset delivered or received under the applicable barter rules.
Each disposal should be calculated separately, and adequate euro valuations should be retained. Spanish Tax Agency
Cryptocurrency Records
Crypto investors should retain:
- exchange transaction histories;
- purchase and sale confirmations;
- wallet addresses;
- euro values at the time of each transaction;
- trading and network fees;
- records of transfers between personal wallets;
- evidence showing the origin of the assets.
Moving cryptocurrency between wallets owned by the same taxpayer is not normally a disposal by itself. However, documentation is important to prove that ownership did not change.
Mining, staking, lending rewards and professional trading may be classified differently from a private capital gain. The calculator’s standard crypto route is intended for the disposal of cryptocurrency held as a private investment.
Selling Real Estate in Spain
A Spanish tax resident who sells real estate generally calculates the gain as the difference between the adjusted disposal and acquisition values.
The acquisition value can normally include:
- the original purchase price;
- transfer tax or VAT paid on acquisition;
- notary and land registry expenses;
- professional fees connected with the purchase;
- documented capital improvements.
Routine maintenance and ordinary repairs are not necessarily treated as capital improvements.
The disposal value is generally the sale price reduced by eligible costs and taxes paid by the seller in connection with the transfer, such as estate-agent fees and certain legal expenses.
Any tax depreciation previously deducted from rental income may reduce the property’s acquisition value and consequently increase the taxable gain.
Municipal Tax on Urban Land
Selling urban property in Spain can also generate a separate municipal liability known as plusvalía municipal.
This local tax is distinct from national personal income tax on the capital gain. It broadly concerns the increase in the value of the urban land associated with the property.
Whether it applies and the amount payable depend on factors such as:
- the municipality;
- the cadastral land value;
- the period of ownership;
- the documented increase in value;
- the calculation method available under local rules.
The Finorum calculator’s standard national capital gains result does not automatically reproduce every municipality’s local tax calculation. This charge should therefore be checked separately.
Main-Residence Reinvestment Exemption
A capital gain from selling a qualifying main residence may be fully or partially exempt when the proceeds are reinvested in another qualifying main residence.
The reinvestment must generally take place within two years before or after the sale. It can be completed in one transaction or through several payments.
A full exemption may be available when the qualifying amount obtained from the old home is fully reinvested. If only part is reinvested, the corresponding proportion of the capital gain may be exempt.
The exemption does not apply automatically. The taxpayer must claim it and satisfy the legal requirements concerning both the previous and replacement homes.
The Spanish Tax Agency confirms the two-year reinvestment period and the proportional exemption for partial reinvestment. Spanish Tax Agency
What Counts as a Main Residence?
For tax purposes, a property is generally considered a habitual or main residence when the taxpayer has lived in it continuously for at least three years.
A shorter occupation period may still qualify where circumstances necessarily require a change of residence, such as:
- marriage;
- separation;
- employment relocation;
- obtaining or changing employment;
- death;
- another comparable justified circumstance.
The replacement property must normally be occupied effectively and permanently within 12 months of its acquisition or completion.
The detailed facts should be checked carefully because owning or registering an address does not by itself guarantee that the property qualifies as a habitual residence.
Exemption for Sellers Aged 65 or Over
A person aged 65 or over can generally sell their qualifying main residence without paying personal income tax on the resulting capital gain.
No reinvestment in another home is normally required for this exemption.
The property must constitute the taxpayer’s habitual residence at the time of the sale or generally have held that status at some point during the two years preceding the sale.
The exemption can also apply where the taxpayer transfers bare ownership while retaining a lifetime usufruct, subject to the applicable requirements.
The Spanish Tax Agency confirms the exemption for capital gains arising from the disposal of a qualifying habitual residence by taxpayers aged 65 or over. Spanish Tax Agency
Other Assets Sold by Taxpayers Aged 65 or Over
A separate exemption may be available when a taxpayer aged 65 or over sells an asset other than their main residence and reinvests the proceeds in a qualifying insured life annuity.
The reinvestment is subject to legal conditions, a time limit and a maximum qualifying amount. A partial reinvestment may provide only a proportional exemption.
Because an eligible annuity must meet specific statutory requirements, an ordinary investment account or informal income arrangement will not qualify.
Filing and Paying the Tax
Spanish tax residents generally report capital gains and losses in their annual personal income tax return, known as the Declaración de la Renta or IRPF return.
The reporting period normally takes place during the year following the disposal. The precise filing calendar is announced by the Spanish Tax Agency for each annual campaign.
Relevant records can include:
- purchase and sale contracts;
- broker statements;
- invoices and transaction fees;
- cryptocurrency histories;
- evidence of capital improvements;
- notary and registry documents;
- proof of reinvestment in a new main residence;
- documents supporting any exemption.
Gains from Spanish and foreign assets may need to be reported by Spanish tax residents because Spain generally taxes residents on worldwide income.
Non-Residents Selling Spanish Property
A non-resident selling property located in Spain is subject to rules different from those used in the standard resident calculation.
The purchaser is generally required to withhold 3% of the agreed sale price and pay it to the Spanish Tax Agency as a payment on account of the seller’s final non-resident tax liability.
The 3% withholding is not necessarily the final tax. The non-resident seller must calculate the actual gain and submit the appropriate return. Depending on the result, an additional amount may be payable or part of the withholding may be refunded.
Non-residents should therefore not rely exclusively on the resident calculator.
Calculation Assumptions
Unless otherwise selected, the calculator assumes that the user:
- is an individual tax resident in Spain;
- owns the asset privately;
- is not acting as a professional trader;
- can document the acquisition value and eligible expenses;
- reports relevant worldwide investment disposals;
- has entered other savings income where required;
- applies the rules relevant to disposals in 2026.
Special rules may apply to inherited or gifted assets, employee shares, collective investment funds, business assets, historic investments, derivatives and transactions between related parties.
Important Notice
The Finorum Spain Capital Gains Tax Calculator provides an estimate for informational purposes only. The final liability can depend on the taxpayer’s total savings income, available losses, acquisition history, autonomous-community circumstances, legal classification of the asset and eligibility for an exemption.
The calculator does not automatically calculate every local charge, including the exact municipal tax on urban land, and it does not replace the separate rules applicable to non-residents.
Before completing a significant transaction or filing an official return, consult a qualified Spanish tax adviser or the Agencia Estatal de Administración Tributaria.
Spain capital gains tax calculator
Matias Buće has a formal background in administrative law and more than ten years of experience studying global markets, forex trading, and personal finance. His legal training shapes his approach to investing — with a focus on regulation, structure, and risk management. At Finorum, he writes about a broad range of financial topics, from European ETFs to practical personal finance strategies for everyday investors.

