Timing before you arriveArticle 1 of 6 · 10 min read
Should you sell investments before you move? The calendar-year rule
Explains why selling investments earlier in the year you arrive in Spain does not avoid Spanish tax, and what does. For anyone with shares, funds or other gains deciding whether to sell before moving.
Key rules
- Whole-year residence: If you spend more than 183 days in Spain in a calendar year, or your main economic interests are there, Spain taxes you as resident for the whole year.
- Date of sale: Spanish tax depends on the date of the sale, not the date you arrive.
- Earlier year: A gain realised in a calendar year before you become resident falls outside Spanish income tax.
- Foreign tax credit: Foreign tax paid on a gain Spain also taxes can be deducted, up to the Spanish tax due on that income.
The short answer
Selling a few weeks before you move does not help if you become Spanish tax resident that same year. Spain treats you as resident for the whole calendar year, so gains from January onwards are taxed in Spain. Only a sale in an earlier calendar year, or relief under a tax treaty or a foreign tax credit, avoids or reduces Spanish tax on the gain.
Why the arrival year counts in full
Spain has no part-year residence. If you are resident, you are taxed on your worldwide income for the full year from 1 January to 31 December. That includes income earned before you set foot in Spain.
The 183 days are counted inside the calendar year. Short trips abroad usually count as time in Spain unless you can prove tax residence in another country. You can also be resident if your main economic interests are in Spain. Residence can also be presumed if your spouse and minor children live in Spain, unless you prove otherwise.
What this means for a sale
Spanish tax follows the date of the sale, not the date you arrive.
- Sale in the year before you become resident: the gain falls outside Spanish income tax.
- Sale in the arrival year, even before you move: the gain goes into your Spanish savings income and is taxed there.
So if you have large unrealised gains, the useful question is which calendar year you sell in, not how many days before the move.
Can a tax treaty help?
Sometimes. Treaties have tie-breaker tests for residence: permanent home, centre of vital interests, habitual abode and nationality. If the treaty makes you resident of the country you left for the arrival year, Spain treats you as non-resident for that year and taxes only Spanish-source income. Gains on shares are then usually taxable only in the country you left.
If the treaty gives residence to Spain, the whole year is Spanish. Spain generally applies the tie-breakers to the whole year and does not recognise split-year residence the way the UK does. Treaties differ, so the result depends on your country and your facts. Do not plan a sale around a treaty without advice.
Credit for foreign tax
If a gain is taxed both abroad and in Spain, you can deduct the foreign tax from your Spanish tax. The deduction is the lower of the foreign tax actually paid and the Spanish tax due on that income. It is worked out by country and income type. Excess foreign tax is generally lost, though in some cases it can be carried forward for four years.
You claim it in the Spanish income tax return for the year the gain is taxed in Spain. If you pay the foreign tax later, claim it in the year you pay, with a corrected return for the earlier year if needed. Keep certificates or receipts of the foreign tax.
How to decide
- Work out your likely residence year, using the 183-day count and where your family and main interests will be.
- If you can sell in an earlier calendar year, that is the cleanest way to keep the gain out of Spanish tax. Weigh it against the tax you will pay in the country you are leaving.
- If your move falls early in a year, you may be able to sell in the year before. A move late in a year gives you less room.
- If you cannot sell earlier, check the treaty and plan on claiming credit for foreign tax.
- If you plan to use the Beckham regime, foreign gains are treated differently. Ask an adviser before you sell.
The decision, timeline and checklist below help you compare options and prepare. Take advice from advisers in both countries before you sell anything large.
Choosing between options
Should you sell your investments before you move, and in which year?
-
Sell in a calendar year before the year you become resident: You can complete the sale in an earlier calendar year than your arrival year.
-
Sell in the arrival year, before you physically move: You cannot wait or avoid the arrival year. The gain is still taxed in Spain, because the tax follows the sale date, not your arrival date. Foreign tax paid on it may be credited.
-
Rely on a tax treaty for the arrival year: Your old country has a treaty with Spain that makes it your country of residence for the arrival year. Spain then taxes only Spanish-source income. Get advice on the specific treaty first.
-
Keep the investments and sell later as a Spanish resident: The gain is small, or selling early would cost you more in foreign tax. Spain taxes the gain, with credit for foreign tax paid.
Pre-move tax timeline from twelve months out to arrival
-
Start your pre-arrival tax planning and list the sales, transfers and withdrawals you might make: 6 to 12 months before the move
-
Take advice from a tax adviser in Spain and one in the country you are leaving: at least 6 months before the move
-
Start any transfer or restructuring, such as a company, a trust or consolidating funds: 3 to 6 months before the move
-
If your adviser recommends it, ask Spain's tax authority for a binding ruling on your case, which can take several months: as soon as your adviser confirms you need one, several months before the move
-
Complete sales of appreciated assets and pension withdrawals before the date you become Spanish tax resident. Once you are resident, Spain taxes the whole calendar year, so a sale early in the arrival year is not shielded: before your Spanish residency date, with margin before the year-end
-
Keep a day-by-day record of where you spend your time, so you can show whether you pass more than 183 days in Spain: from now until the end of the arrival year
-
If you plan to claim the Beckham regime (Spain's special tax regime for newly arrived workers), file the application: within 6 months of starting work or registering with Social Security
The lead times are practitioner rules of thumb, not an official schedule. Confirm them with a tax adviser before you plan around them.
Documents you need
-
Certificates or receipts showing the foreign tax you paid on the gain, needed to claim credit for it in your Spanish income tax return (Modelo 100)
-
Your Spanish income tax return (Modelo 100) for the year the gain is taxed in Spain, where the foreign tax credit is claimed
Your move date and the tax events of the move year
-
Classify your move date as fixed, a rough window or undecided. With a fixed date, you can schedule sales, transfers and withdrawals before it. With a rough window, plan around the earliest date in it and book advice now. If it is undecided, only gather records and take advice, and do not make irreversible sales.
-
Write down every event of the move year that could carry tax or reporting: a home sale, a sale of shares or funds, a large payment or transfer, a change of income, a pension withdrawal or lump sum, and foreign accounts, securities or property.
-
Check both calendars your date depends on: the Spanish calendar year, where more than 183 days in Spain makes you resident for the whole year, and your origin country's tax year, which may tax part of the year.
-
Book a tax adviser before you fix any date if you have a home sale, shares in a company, large unrealised gains, a pension or lump sum, share options, a business sale, a 183-day question or a possible Beckham regime claim.
-
While the date or an event is still unknown, keep a record of your days in each country, collect purchase and sale documents and valuations, avoid irreversible sales or withdrawals, and keep your origin-country tax ties documented.
One-page brief for your tax advisers
Use this brief to put your situation on one page, then send the same page to an adviser in the country you are leaving and an adviser in Spain. Fill in every blank. Write "none" where something does not apply, so the advisers know you did not forget it.
How to use it
- Fill in the blanks in the brief below.
- Send the whole page to both advisers at the same time, so each knows the other exists.
- Ask each adviser to answer in writing, and to say which questions belong to the other country.
- If the two advisers give different advice, send each one the other's written reply and ask them to settle the difference before you act.
- Send the brief before you sell, gift, cash in or move any asset, because some of these steps cannot be undone.
The brief
My details
- Name: ____
- Country I am leaving (origin jurisdiction): ____
- Country and town I am moving to: Spain, ____
- Citizenship(s): ____
My move date
- Choose the line that fits and delete the others:
- My move date is fixed: ____
- I expect to move between ____ and ____
- I have not decided yet. The earliest I could move is ____
- The date I plan to stop living in my home country is ____
- The date I plan to start living in Spain is ____
What happens in my first tax year in Spain
List every event you expect in your first calendar year after arriving, with the month if you know it. Think of sales of shares, funds or crypto, a business sale, a pension payment, a large gift or inheritance, a bonus or stock vesting, and any other big income.
| Event | Expected date | Approximate amount and currency |
|---|---|---|
| ____ | ____ | ____ |
| ____ | ____ | ____ |
| ____ | ____ | ____ |
Assets I may sell, cash in or transfer
- The asset: ____
- The date of the sale or other event, or the window I am considering: ____
- What you paid for it and when: ____
- What it is worth now: ____
- Can I move this date earlier or later? Yes / No. If yes, by how much: ____
My home in the country I am leaving
- I plan to sell my home there: yes, on or around ____ / no / undecided
- I have lived in it as my main home since: ____
- Expected sale price and what I paid: ____
- If I keep it, I will rent it out: yes / no
Property or accounts outside both countries
- I own property in a third country or in Spain: yes, ____ (where, and its value) / no
- I hold bank, investment or pension accounts abroad: yes, ____ (country and approximate total) / no
Questions for both advisers
- Which country taxes each event listed above, and in which tax year?
- Would a different date for any event, before or after my move, change the tax I pay? If so, which date do you recommend?
- Will I be treated as a tax resident of both countries at the same time? If so, how is that settled?
- Which forms must I file in each country, by what deadlines, and what happens if I miss them?
- Do the two countries have a tax treaty that affects me, and how do I claim any relief it gives?
- How do I avoid paying tax twice on the same income or gain?
- Which reports are due on my overseas assets and accounts once I live in Spain?
- What documents should I keep from now on, and what do you need from me?
Anything else I want the advisers to know
How to reach me
- Email: ____
- Phone: ____
- Best time to reach me: ____
- I need your reply by: ____
Frequently asked questions
Can a tax treaty stop Spain taxing a sale I made before I arrived?
Yes, a tax treaty can stop Spain taxing that sale, but only if it makes your old country your residence for the arrival year.
Does Spain recognise split-year residence like the UK does?
No, Spain generally does not formally recognise split-year residence, even if your old country does. It applies treaty tie-breakers to the whole calendar year. A treaty with a country that has split-year rules can still lead to different results in practice, so check the specific treaty.
Can I get credit in Spain for tax I already paid abroad on a gain?
Yes, Spain gives a credit for foreign tax paid on a gain that Spain also taxes, but it is capped.
What if I pay the foreign tax after the Spanish return is filed?
You claim the credit in the year you pay the foreign tax. If needed, you file a complementary return for the earlier year. Keep the receipts or certificates that prove the payment.
More in Timing before you arrive
Need certainty before you act?
For important relocation decisions, speak with a qualified human specialist.
Always verify important information with the relevant official authority or a qualified adviser before acting. This website uses large language models together with various public data sources, official government documents and other established sources. Due to the amount of data on this website, some information might be wrong. Information may also be incomplete or outdated.