I am thinking of moving to Portugal or Andorra before selling my company: will I save tax or will the Spanish exit tax apply, and which deadlines matter?
Changing residence just before selling almost never saves the capital gains tax. The exit tax charges the latent gain when you leave and, if you move within the EU, when you sell in the following ten years.
Author
Capittal Research
Equipo editorial M&A
Editorial review
Equipo M&A Capittal
Financial, tax and legal review
Updated
15 November 2026
Content reviewed as markets evolve

Quick answer
Capittal's view is that changing residence just before selling the company almost never saves the capital gains tax. If you have been resident for at least ten of the last fifteen years and your shares are worth more than 4 million euros, or more than 1 million with a stake above 25% in one company, article 95 bis of the Spanish Personal Income Tax Act taxes the latent gain when you leave; and if you move within the EU, to Portugal for example, it is taxed anyway if you sell in the following ten years. A move makes sense as a long-term life decision, not as a tax manoeuvre for the deal.
What is the exit tax and who does it affect?
The exit tax is a deemed capital gain. When you stop being a Spanish personal income taxpayer because you change residence, you are taxed as if you had sold your shares: on the difference between their market value and their acquisition cost.
It applies when two conditions are met together:
- You have been a Spanish personal income taxpayer for at least ten of the previous fifteen tax years.
- Your shares are worth more than 4 million euros in total, or you hold more than 25% of a company whose shares are worth more than 1 million euros.
The gain is taxed in the savings income base and allocated to your last return as a resident.
For unlisted companies, the law values the shares at the higher of two amounts: net equity in the last balance sheet, or average profit over the last three years capitalised at 20%. It accepts evidence of a different market value, and a purchase offer on the table is exactly that evidence.
What happens if I move to Portugal or another EU country?
If you move to another European Union or European Economic Area state with effective exchange of tax information, you can elect not to pay on departure. In exchange, you will have to self-assess the exit tax if any of three things happens in the following ten years:
- You transfer the shares.
- You stop being resident in the EU or the EEA.
- You fail to meet the obligation to report your situation to the Spanish tax authorities.
Applied to a sale: if you move to Portugal and sell the company the following year, you pay tax in Spain on the gain accrued up to your departure. The gain arising after departure will depend on Portuguese tax and on the double tax treaty. Portugal has also restricted its former non-habitual resident regime, so check the current regime with a Portuguese adviser.
And if I move to Andorra?
Andorra is not part of the EU or the EEA, so the ten-year deferral option does not exist. The exit tax is assessed in your last return as a resident. The law only provides a deferral, with guarantees, for temporary moves to countries with a tax treaty and information exchange; if you sell the shares, the deferral falls away and the tax is paid.
There is also a specific rule for tax havens: a Spanish national who moves their residence to a jurisdiction classed as a tax haven remains a Spanish personal income taxpayer in the year of the move and the following four (article 8.2 of the Personal Income Tax Act). Andorra is not currently on Spain's list of non-cooperative jurisdictions, but the list is reviewed, so check it on the date of the move.
When do I stop being tax resident in Spain?
You are resident if you spend more than 183 days in Spain in the calendar year or if the main centre of your activities or economic interests is here. Residence is also presumed if your non-separated spouse and minor children live in Spain.
Residence is determined for the whole calendar year. If you leave in September, you will normally remain resident for that entire year, and a sale signed in that year will be fully taxed in Spain. The tax authorities look closely at moves that coincide with a sale: you will need a tax residence certificate from the new country and a real life there.
What does work to reduce the tax on the sale?
Effective tools are prepared in advance and without changing country:
- Selling through a holding company set up in advance and with a genuine business purpose, which can apply the exemption in article 21 of the Corporate Income Tax Act.
- Timing of the deal, including distributing surplus cash with enough margin.
- Price structure: deferred payments and earn-outs with planned timing of taxation.
If you really want to live abroad, the decision has to be made years before the sale, with effective residence already established and the exit tax calculated.
What is the next step if I am thinking of selling and moving?
First check whether you exceed the exit tax thresholds using a realistic valuation, then compare three scenarios: selling while resident, selling after moving within the EU, and selling after moving outside the EU. This article is for guidance only and does not replace tax advice on your specific case, which in a move also requires an adviser in the destination country; within the NRRO group we have tax and legal teams to review it.
Capittal Transacciones is an M&A mid-market boutique advising deals from 3 to 250 million euros from eight offices across Spain (Barcelona, Madrid, Girona, Lleida, Tarragona, Palma de Mallorca, Zaragoza and Valencia), part of the NRRO group. A partner leads your deal from start to finish and works with you directly. If you want to know what your business is worth today and what to prepare before selling it, request a free and confidential valuation.
Frequently asked questions
Common questions on this topic.
What is the exit tax in Spain?+
It is the tax in article 95 bis of the Spanish Personal Income Tax Act. When you stop being resident, you are taxed as if you had sold your shares, on the difference between their market value and their cost. It applies if you were resident for at least ten of the last fifteen years and your shares exceed the legal thresholds.
From what amount does the exit tax apply?+
When the market value of your shares exceeds 4 million euros in total, or when you hold more than 25% of a company whose shares are worth more than 1 million euros. In the second case, only those shares are taxed.
If I move to Portugal, do I pay the exit tax?+
If you move to another EU or EEA state, you can elect not to pay it on departure. But you will have to self-assess it if, in the following ten years, you sell the shares, stop being resident in the EU or EEA, or fail to meet the reporting obligation. Selling soon after moving triggers the tax.
And if I move to Andorra?+
Andorra is not in the EU or the EEA, so the ten-year deferral option does not exist. The exit tax is assessed in your last return as a resident, except for a deferral with guarantees designed for temporary moves. If you sell, it is paid.
When do I stop being tax resident in Spain?+
When you no longer meet the Spanish tests: spending more than 183 days in Spain in the calendar year, or having your main economic interests here. Residence is determined per calendar year, so in the year you move you will normally still be resident.


