Extranjeros

Moving to Spain from the US: taxes on Social Security, IRA, 401(k) and a home sale

Moving to Spain from the US: taxes on Social Security, IRA, 401(k) and a home sale
Administración de la Agencia Tributaria en Alcorcón (Madrid). Foto: Zarateman / Wikimedia Commons, CC0 (recortada).

Reviewed against the official source: · Author: · How we check facts

In short: moving to Spain from the US, your taxes depend mostly on whether you become a Spanish tax resident: more than 183 days in the calendar year, or the center of your economic interests in Spain. If you do, you report your worldwide income in Spain (Social Security, IRA, 401(k), the sale of your home) and the US keeps taxing you as a citizen; the tax treaty and credits are there so you do not pay twice on the same income. The Beckham law is for people who move for work, not for a retiree on a non-lucrative residence.

Diagram: six situations of an American moving to Spain and the Spanish tax treatment of each
Arts. 9 and 93 of the IRPF law and the Spain-US tax treaty (BOE-A-1990-30940).

First: are you a tax resident in Spain?

Art. 9 of the IRPF law (IRPF is Spanish income tax) makes you a resident if you spend more than 183 days in Spain in the calendar year or if the main base of your activities or economic interests is here. Details and evidence: Spanish tax residency and the 183-day rule.

  • A visa or TIE card is not tax residency. The AEAT (the Spanish tax agency) notes that you can hold a residence permit in a country without being a tax resident there. Days and center of interests decide.
  • There is no split year. You are a resident or a non-resident for the whole calendar year. If you arrive in February and pass 183 days, you also report what you earned before you moved.
  • Schengen (90 days in any 180) is not the same as the 183 days. The 90-day limit is for a short visit; stays of more than 90 days follow national procedures (European Commission). With a visa or residence authorization you are not visiting, and the 183 days for IRPF are counted separately, by calendar year.
  • If you travel a lot. Occasional absences count as days in Spain unless you prove tax residency in another country (art. 9.1.a). That proof is a certificate from that country's tax authority; the IRS issues Form 6166. Whether the AEAT accepts it in your case, and how your center of interests weighs, is a question for the AEAT.
  • If both the US and Spain treat you as a resident. Art. 4 of the treaty decides in order: permanent home, center of vital interests, habitual abode and nationality.

If you arrive in the second half of the year

You can be a non-resident that year. From 1 July to 31 December there are 184 days: arriving on 1 July and staying to the end of the year passes the 183 (our count; add any other stay earlier that year). Arriving on 2 July or later, you do not pass 183 days; even so, you will be a non-resident only if the center of your economic interests is also not in Spain and your spouse and dependent minor children do not live here.

As a non-resident you are taxed in Spain only on income earned here, under the non-resident income tax (IRNR). A pension counts as earned in Spain only if it comes from work done here or is paid by a Spanish resident or a permanent establishment (art. 13.1.d of the IRNR law). Social Security, an IRA or a 401(k) paid by a US institution meets neither test, so those payments are not Spanish-source income. If you also collect rent on property in Spain, you declare it with the Modelo 210. The following year, if you pass 183 days, you are a resident for that whole year.

Which country taxes what

  • Citizenship. The US taxes its citizens on worldwide income (IRS) and the treaty keeps that (art. 1.3, the «saving clause»). You keep filing your US return while you live in Spain. The IRS foreign earned income exclusion (FEIE) does not cover pensions or Social Security.
  • How double taxation is avoided. Spain deducts US tax paid on income the US may tax for reasons other than your citizenship (art. 24 of the treaty and art. 80 of the IRPF law: international double taxation relief). Income the US taxes only because of your citizenship is treated as earned in Spain to the extent needed to avoid double taxation, provided the US tax is not lower than you would pay if you were not a citizen (art. 24.3). The US gives a credit for Spanish tax (IRS, foreign tax credit, Form 1116). Both credits have limits, and the result depends on your case.
  • State taxes. The treaty refers to US federal income taxes (art. 2). For your state tax, ask your state tax agency.

US Social Security

Art. 20.1.b of the treaty lets the US tax its Social Security benefits. The DGT (the Directorate General of Taxes) said in V0249-20 (04.02.2020) that Spain also taxes them under IRPF, according to the IRPF law, and that the tax paid in the US is deducted under art. 80 of the IRPF law.

IRA, 401(k) and Roth IRA

For the treaty, the 401(k), the IRA and the Roth IRA are «pension funds» (point 3.a of the Memorandum to the 2013 Protocol). Private pensions for past employment are taxed only in the country where you live, Spain (art. 20.1.a), and the US also taxes you as a citizen. Art. 20.5 says income from a pension fund is taxed when it is paid to the person, not when the fund is moved to another fund in the same country. How IRPF classifies it depends on the account, and the DGT does not treat them all the same:

  • US workplace plan (V0251-25, 05.03.2025: a company plan funded only by the employer): the DGT says in general that what you receive from private plans linked to a job is employment income (art. 17.1 of the IRPF law). A 401(k) is also a company plan, but that ruling does not deal with a 401(k): confirm yours with a binding ruling. A direct transfer to another US fund, such as an IRA, is not taxed in Spain. If the money is paid to you or taken out of the US, it counts as a withdrawal.
  • IRA not tied to a job (V1133-17, 10.05.2017): taxed only in Spain as «other income» (art. 23 of the treaty); the US also taxes you as a citizen (art. 1.3). It predates the 2013 Protocol and does not separate out the Roth.
  • Roth IRA (V1291-22, 07.06.2022): not tied to a job, art. 23. The DGT treats it as investment income (art. 25.3.a of the IRPF law, like a life insurance policy): the difference between what you take out and what you paid in is taxed, and contributions give no reduction. What is «tax-free» in the US is not automatically tax-free in Spain.
  • IRA tied to US government employment (V1291-22): taxed only in the US (art. 21.2.a), unless you also hold Spanish nationality (art. 21.2.b).

These are different cases, and the classification of your own account is confirmed with a DGT binding ruling (consulta vinculante).

Stocks, funds and other investments

Gains from selling stocks or funds that are not a pension plan are taxed only in the seller's country of residence (art. 13.6): Spain, if you live here; the US also taxes you as a citizen, with a credit. Trading from your laptop changes nothing: a resident reports worldwide income (art. 2 of the IRPF law).

Selling your home in the US

  • The treaty lets the US tax the gain on real estate located there (art. 13.1), and as a resident of Spain you are taxed here too. US tax is deducted (art. 80). The DGT applied this to the sale of a house in Mexico (V1035-23): the gain goes into the savings base of the IRPF.
  • The year of the sale counts, not the order of events. With no split year, if you pass 183 days in Spain in the year of the sale, you are resident for that whole year and the sale, even if it came before you arrived, goes into your IRPF. Selling in January and arriving in February, with more than 183 days in Spain that year, is that case. If you are resident in Spain that year and the US also treats you as a resident, art. 4 of the treaty may come into play: confirm it with your adviser or with a binding ruling. If you are not resident that year, the gain is not part of your IRPF (IRNR taxes only income earned in Spain), although the US still taxes you.
  • People over 65. If you are over 65, the gain on selling your home may be exempt if it is your main home (art. 33.4.b of the IRPF law). A main home is one you have lived in continuously for at least 3 years; for this exemption, one that was your main home up to any day in the 2 years before the sale also counts (art. 41 bis of the IRPF Regulation). The DGT recalls the exemption in V1035-23 for a house sold outside Spain. Whether your US house counts as your main home is a matter of facts and proof: confirm it first with a binding ruling.
  • Reinvesting in a new main home. In V5695-26 (30.09.2026) the DGT looked at this case: someone resident in Spain since 2026 sells a house in the US in 2027. Until the move, it had been their main home for 3 years or more. The reinvestment exemption (art. 38 of the IRPF law and art. 41 of the Regulation) can apply. The house counts as a main home if it was one when you sell or up to any day in the 2 years before. You reinvest within the 2 years before or after the sale. If you reinvest everything, the whole gain is exempt; if you reinvest part, only the proportional part, and the rest goes into the savings base (art. 49).
  • US side. The IRS lets you exclude up to $250,000 of the gain on your main home ($500,000 on a joint return) if you meet its conditions (IRS, Tax Topic 701).

Taxes when selling a home in Spain: guide to selling property.

Modelo 720 and wealth tax

  • Modelo 720. If you are a resident and hold accounts, securities, insurance or property outside Spain worth more than €50,000 in a category, there is an information return due by 31 March: Modelo 720.
  • IRA and Roth IRA. The DGT concluded in V1291-22 that they must be reported, because they allow withdrawals at any time (a surrender right similar to a life insurance policy). You report their value on 31 December.
  • 401(k). According to the AEAT, foreign pension plans are not reported while no pension is being paid, unless the plan allows surrender like a life insurance policy. Whether your 401(k) allows withdrawals at any time and how it fits is a question for the AEAT or a binding ruling.
  • Beckham. Whoever applies the art. 93 regime does not file the Modelo 720 (AEAT FAQ). A spouse and children may have to file if they are tax residents.
  • Wealth tax. The DGT (V1291-22) includes the IRA and the Roth IRA in net wealth and does not apply the pension-plan exemption to them. It is a state tax ceded to the autonomous communities, which have regulatory powers over it (V1291-22), so the result depends on where you live: ask the tax office of your community.

Remote work, 1099 and the Beckham law

  • Non-lucrative residence. It is for living in Spain without carrying out employment or professional activity: non-lucrative residence. To work remotely for clients or a company outside Spain there is the international teleworking authorization.
  • If you are a 1099 contractor. Getting your visa approved does not make you a tax resident; days and center of interests count. While you are not resident in Spain, art. 15 of the treaty gives the US the tax on independent professional services of a US resident, unless you have a fixed base in Spain. From the calendar year you are resident, your worldwide income, 1099 included, is taxed under IRPF: taxes for foreign self-employed workers. Social Security contributions are separate: ask the Spanish Social Security about the Spain-US Social Security agreement.
  • If you are an employee of a US company and live in Spain, your salary is employment income (V0358-23, 21.02.2023). Withholding and foreign-employer cases: teleworking for a foreign company.
  • The Beckham law. Art. 93 of the IRPF law has four routes: an employment contract (remote work included, with the teleworking visa), director of an entity, entrepreneurial activity, and highly qualified professional for start-ups or R&D. The DGT accepted the regime for a remote employee with a teleworking visa who met the other conditions (V1115-25, 26.06.2025). A retiree on a non-lucrative residence fits none of them. If you move under a contract and want to know how your IRA or 401(k) withdrawals would be taxed inside the regime, or whether a 1099 contractor fits, that is a question for a binding ruling. Requirements and deadline: Beckham law and Modelo 149.

What to do and where to ask

  1. Write down your arrival date and count your days of presence in Spain in the calendar year, and keep your tickets and other travel records.
  2. Sort your income by type: Social Security, workplace plan, IRA or Roth, investments, home sale, work.
  3. Ask your gestor or a tax adviser with US-Spain experience to prepare both returns, the US one and the IRPF one, because the credits in one depend on the other, and to explain which boxes they use for Social Security and the Roth IRA. Ask for the quote in writing.
  4. For your first Renta: tax return for foreign residents. If you need to prove residency: tax residency certificate.
  5. For a specific question, the AEAT answers on 901 33 55 33 and the DGT answers binding rulings (arts. 88 and 89 of the General Tax Law). For the US side, see the IRS.

Official source: Spain-US tax treaty (BOE-A-1990-30940), 2013 Protocol (BOE-A-2019-15166), IRPF law 35/2006 and DGT binding rulings.

Informational only; check the official source and a professional for your specific case. Figures and dates checked on 31 October 2026.

Frequently asked questions

What taxes do you pay when moving to Spain from the US?

It depends on whether you are a Spanish tax resident: you are if you spend more than 183 days in Spain in the calendar year or if the center of your economic interests is here (art. 9 of the IRPF law). If you are, you report your worldwide income in Spain (Social Security, IRA, 401(k), rents, gains) and the US keeps taxing you as a citizen; the treaty and credits stop you paying twice on the same income. If you arrive mid-year and meet neither test, you are taxed in Spain that year only on what you earn here.

Do I pay tax in both Spain and the US on the same income?

The US taxes its citizens wherever they live (art. 1.3 of the treaty) and Spain taxes you as a resident. To avoid paying twice, Spain deducts US tax paid on income the US may tax for reasons other than your citizenship (art. 24 of the treaty and art. 80 of the IRPF law), and the US gives a credit for Spanish tax (IRS, Form 1116). Both credits have limits, and how much each country deducts depends on your case.

How are Social Security, an IRA and a 401(k) taxed in Spain?

US Social Security is included in your IRPF return, and the tax paid in the US is deducted (DGT, ruling V0249-20). Money taken from a US workplace plan is employment income (V0251-25). A Roth IRA not tied to a job is taxed as investment income on the difference between what you take out and what you put in (V1291-22). The DGT classifies each account by its type: confirm yours with a binding ruling.

If I sell my US home before moving to Spain, do I pay tax in Spain?

It depends on your residency in the year of the sale. Spain has no split year: if you spend more than 183 days in Spain that calendar year, you are resident for the whole year and the gain from a sale before you arrived goes into your IRPF; if the US also treats you as a resident that year, art. 4 of the treaty may change the result. If you are not resident that year, the gain is not part of your IRPF, although the US still taxes you. People over 65 may have an exemption on the sale of their main home (art. 33.4.b): check whether your house counts as one.

Can I use the Beckham law with a non-lucrative visa?

No. The Beckham law (art. 93 of the IRPF law) requires that you move to Spain for an employment contract (remote work included, with the teleworking visa), as a company director, for an entrepreneurial activity or as a highly qualified professional. The non-lucrative residence is for living in Spain without working, and a retiree living on pensions does not fit those routes.

Official source: boe.es

On video: this guide explained

Moving to Spain from the US: taxes on Social Security, IRA, 401(k) and a home sale

Order a guide or ask a question

Tell us which guide you need or your question — we’ll get it and reply on Telegram.

No spam. This is not individual legal advice.

General information, not individual legal advice. Check the official source and consult a professional for your case.

Want to keep up with changes for foreigners in Spain?

One email every Tuesday. Free gift: the «Arraigo in Spain: the 5 types» guide (PDF). No spam · privacy

Have a question about your case?

Describe your situation and your questions — we study them and reply in writing. The first look is free.

Leave my questions →

If you prefer, also directly to @spain_asesor on Telegram (the form is better).

Get the free guide

Guide «Arraigo in Spain: the 5 types» (PDF), instantly

No spam · privacy

or on Telegram
Get it on Telegram

Can’t find what you need? Message us on Telegram →