If you are an AI engineer or software worker thinking about moving to Spain, the Beckham Law is the tax rule everyone eventually asks about. In short: Spain's Beckham Law (officially the special regime for inbound workers, or regimen especial para trabajadores desplazados) lets people who become Spanish tax residents after moving for work pay a flat rate of roughly 24 percent on their Spanish employment income, instead of the normal progressive rates that climb toward 47 percent, for the year they arrive plus the following five years. It is a genuine tax break for well-paid newcomers. It is also easy to lose on a technicality, and it is not a visa.
What the Beckham Law actually is
The Beckham Law gets its nickname from the footballer who was an early high-profile user, but the mechanism is dull in the way good tax rules are. Normally, once you spend enough time in Spain to become a tax resident, Spain taxes your worldwide income on a progressive scale that reaches around 47 percent at the top. Under this special regime, you stay legally resident but are taxed more like a non-resident: your Spanish-source employment income is taxed at a flat rate of about 24 percent, up to a threshold of 600,000 euros per year, with a higher rate above that. Treat those exact numbers as directional and check the current figures before you rely on them.
There is a nuance worth stating plainly. This is not a blanket exemption on everything. Your employment income is generally pulled into the Spanish net even if some of the work happened abroad, while a lot of your other foreign income usually sits outside Spanish tax during the regime. The precise line between what is caught and what is not has caveats, and it is the kind of detail a Spanish tax advisor earns their fee on. The mechanics and the current rate live on the official Agencia Tributaria special regime page.
Who actually qualifies
The headline condition is a five-year clean slate: you generally cannot have been a Spanish tax resident in the previous five tax years. That window used to be ten years and was shortened by Spain's 2023 Startup Law reform, which also widened who counts as an eligible mover. Your move to Spain also has to be triggered by work rather than by lifestyle. In practice that means an employment contract with a Spanish or foreign employer, a company posting you to Spain, becoming a director of a Spanish company, or coming in as a highly qualified professional, an innovative entrepreneur, or a digital nomad under the newer routes.
AI and machine learning roles fit these categories well. A senior engineer joining a Spanish scale-up on a local contract, a remote worker for a foreign employer moving under the digital-nomad route, or a founder building an ENISA-certified startup can each, in principle, land inside the regime. The catch is that eligibility is checked against your specific facts, so a forum post saying "engineers qualify" is not the same as your situation clearing every box.
How you actually get into Spain to use it
This is the part that trips up otherwise careful people: the Beckham Law is a tax election, not permission to live in Spain. You need a separate legal right to be there first. An EU or EEA passport makes that easy. A non-EU citizen needs a work or residence permit before the tax regime is even relevant.
The two routes AI workers use most are the highly qualified professional permit and the entrepreneur and digital-nomad permits created by Spain's Startup Law (Ley 28/2022), which deliberately pairs easier immigration with the tax break. For an overview of what that law changed, see the official Startup Law summary on the government's ONE platform. Get the visa or permit sorted first: the flat tax rate is a benefit you claim once you are lawfully in and working, not a substitute for the paperwork.
Before you apply: the deadline that quietly disqualifies people
The most common way to lose the Beckham Law is to miss its window. It is not automatic: you have to elect into it, and on time.
- Sort your legal status first. Confirm your right to live and work in Spain: EU citizenship, a highly qualified professional permit, or a Startup Law entrepreneur or digital-nomad route.
- Register and start work. Get on the Spanish social security system as your employment begins, since that registration date starts the clock.
- File the election within roughly six months. The opt-in is made with Modelo 149, generally within about six months of registering with social security. Miss it and you usually cannot claim the regime for that move.
- File the right annual return. While in the regime you typically file the simplified impatriate return rather than the standard resident one.
- Keep the paper trail. Hold on to your contract, proof you were not a Spanish tax resident in the prior five years, and your registration dates.
One honest caveat if you are a US citizen: the United States taxes its citizens on worldwide income no matter where they live, so a Spanish flat rate does not switch off your US filing obligations. This post is informational, not legal, immigration, tax, or financial advice, and Spanish tax rules change, so confirm the current numbers and deadlines before you act.
How it stacks up against other AI hubs
A flat 24 percent on a strong salary is competitive, but the regime rewards higher earners most, because the flat rate only beats the progressive scale once your income has hit the steeper brackets. On a modest local salary the advantage shrinks. So the honest way to compare Spain with France, Germany, or the Netherlands is on take-home pay after tax, not the headline rate alone. Our breakdown of AI engineer after-tax salary by country lines those numbers up so Spain sits next to its neighbors.
The honest takeaway
The Beckham Law is right for a specific person: a well-paid AI or tech professional, ideally non-EU or otherwise new to Spanish tax residency, who is moving on a real work trigger and who will actually file Modelo 149 on time. For that person it can meaningfully lift take-home pay for up to six years. It is a weaker draw for lower earners, for anyone who has been tax resident in Spain recently, and for US citizens counting on it to erase their home tax bill. If you are weighing Spain against other places to build an AI career on visas, pay, and cost of living rather than one tax rule, the AI Relocation Guide lays out the same categories across 21 countries, and you can compare all 21 countries before you commit to anything.
Rule of thumb: the Beckham Law pays off when your salary is high, your last five years were tax-resident somewhere other than Spain, and you file the election within six months. Miss any of those and it is probably not your lever.



