Madrid vs Barcelona is one of the most common questions from tech workers moving to Spain, and the honest answer is that both work. Barcelona has slightly more English-speaking tech jobs on our board and higher posted salaries. Madrid is twice the size, leaves you a little more take-home pay on the same salary, and has a lighter regional income tax. Rent is the biggest cost in both, but Barcelona has rent caps on many new contracts and Madrid does not.
This guide compares the two cities on the things that decide your monthly budget and your career: jobs, pay, tax, rent, transport and language. Every number has a source, and we say when a figure is our own board data rather than an official statistic.
Madrid vs Barcelona at a glance
| Madrid | Barcelona | |
|---|---|---|
| Population (city, 1 January 2025) | 3,506,730 | 1,731,649 |
| English-speaking tech jobs on Spain Dev Jobs (16 October 2026) | 694, at 140 companies | 767, at 150 companies |
| Median posted salary on our board (October 2026 report) | €60,500 (77 ads) | €71,250 (104 ads) |
| Average gross pay in the region, all jobs (INE, 2024) | €34,410.01 (Comunidad de Madrid) | €31,730.05 (Cataluña) |
| Take-home pay on €60,000 (our calculator, 2026 rules) | €42,184 a year | €41,124 a year |
| Rent rise in 2024 (INE) | 3.6% | 3.3% |
| Rent rise 2015 to 2024 (INE) | 22.6% | 24.6% |
| Rent cap zone for new contracts | No | Yes, since March 2024 |
| Official languages | Spanish | Catalan and Spanish |
Population figures are the official 2025 municipal counts, declared by Real Decreto 1117/2025 and quoted by Valencia city council. Both metro areas are much larger than the city figures suggest.
Tech jobs: which city has more?
On Spain Dev Jobs on 16 October 2026, Barcelona had 767 open tech jobs at 150 companies where English is the working language, and Madrid had 694 at 140 companies. Together they hold more than half of the 2,583 jobs in our October 2026 report: Barcelona 30% and Madrid 27%. The next city, Valencia, had 3%.
The mix differs a little:
- Barcelona leans towards product companies, gaming and international start-ups. Employers on the board that week included Preply, Scopely, Socialpoint, Manychat and Voodoo. Barcelona also had most of the jobs that mention visa sponsorship: 16 of its 767 jobs, against none in Madrid.
- Madrid has more banks, insurers, consultancies and corporate tech hubs. That week’s Madrid list included Deutsche Bank, ING, Swiss Re, Accenture, Roche and Ebury, next to start-ups such as Seedtag and Appinio.
- Machine learning and AI is close: 99 jobs in Barcelona and 85 in Madrid (ML and AI jobs in Barcelona, in Madrid).
Almost none of these jobs ask for Spanish. On the city pages, 693 of the 694 Madrid jobs and all 767 Barcelona jobs needed no Spanish at all.
If you don’t want to tie yourself to one city, 829 jobs on the board (32%) were fully remote within Spain or Europe.
Salaries: Madrid vs Barcelona
Three sources point the same way: Barcelona tech pay is a little higher.
- Posted salaries on our board. In the October 2026 report, the median posted salary was €71,250 in Barcelona (104 ads) and €60,500 in Madrid (77 ads). Only about one ad in eight states a salary, and those that do lean towards international companies, so treat this as a signal, not a market average.
- Self-reported pay. On 16 October 2026, Levels.fyi showed a median total compensation of €64,188 for software engineers in the Barcelona area (692 submissions) and €55,731 for Madrid (728 submissions) (Barcelona, Madrid). That includes bonus and stock.
- Official data. The INE does not publish pay for software engineers by city. For all jobs, average gross pay in 2024 was €34,410.01 in the Comunidad de Madrid and €31,730.05 in Cataluña (INE salary survey). Madrid’s higher average comes from its large share of head offices and finance jobs, not from tech.
So for a tech job, expect offers in Barcelona to be equal or slightly higher. But the gap is smaller after tax.
Take-home pay: tax in Madrid vs Catalonia
Income tax (IRPF) in Spain has a state part and a regional part, and each region sets its own scale. The Comunidad de Madrid has one of the lowest regional scales; Catalonia has one of the higher ones. Social security is the same everywhere.
From our salary after tax calculator, for a single person with no children under the 2026 rules:
| Gross salary | Take-home in Madrid | Take-home in Barcelona | Difference a year |
|---|---|---|---|
| €40,000 | €30,196 | €29,464 | €732 |
| €50,000 | €36,190 | €35,308 | €882 |
| €60,000 | €42,184 | €41,124 | €1,060 |
| €70,000 | €48,165 | €46,906 | €1,259 |
| €80,000 | €53,853 | €52,494 | €1,359 |
| €100,000 | €65,227 | €63,590 | €1,637 |
The gap is real but modest: about 2 to 3% of your net pay. A €5,000 higher salary in Barcelona more than makes up for it. You can check any figure, for example €60,000 in Madrid or €60,000 in Barcelona.
If you have just moved to Spain for work, the Beckham Law may apply instead: a flat 24% on salary up to €600,000, the same in every region. Then the regional difference disappears. Read our tax guide before you compare offers.
Rent in Madrid vs Barcelona
Rent decides whether either city is affordable, and it has risen in both.
How fast rents have risen
The INE’s rental price index uses real rental contracts from tax records (INE, published 11 May 2026):
- Madrid: up 3.6% in 2024 and 22.6% between 2015 and 2024.
- Barcelona: up 3.3% in 2024 and 24.6% between 2015 and 2024.
- Spain: new contracts rose 8.8% in 2024, compared with 2.8% for existing ones.
The INE index shows change, not euro amounts. For current asking rents, check property portals for the districts near your office, and see our guide to the cost of living in Madrid.
Rent caps in Barcelona
This is the biggest legal difference between the two cities. Barcelona is a zona de mercado residencial tensionado (stressed housing market zone). It is on the list published in the BOE on 15 March 2024, valid for three years from the next day (Resolution of 14 March 2024). No region other than Catalonia appears on that list, and Madrid is not on it.
In a declared zone, the Urban Leases Act (Ley 29/1994, article 17) limits the starting rent of a new contract:
- If the flat was rented in the previous five years, the new rent cannot be higher than the last rent, after the yearly update. Limited exceptions allow up to 10% more, for example after a renovation.
- If the landlord is a large owner, or the flat has not been rented in five years, the rent cannot be higher than the official reference index for that flat.
In practice, rules like these help tenants on paper but do not create more flats. Expect strong competition for good listings, and read any short-term furnished contract (alquiler de temporada) carefully, since those are not long-term leases.
Rules that apply in both cities
Some rules apply everywhere in Spain (Ley 29/1994):
- A long-term contract for your main home runs for at least five years (seven if the landlord is a company), if you want to stay. You can leave with 30 days’ notice after the first six months.
- The deposit (fianza) is one month’s rent, and extra guarantees are capped at two months on these contracts.
- Agency fees for a long-term rental are paid by the landlord, not the tenant.
Transport and getting around
Both cities have dense metro networks, commuter trains and buses, and both regions discount their monthly passes:
- Madrid: the Consorcio Regional de Transportes (CRTM) sets fares for the Abono Transporte. Prices depend on your zone and age.
- Barcelona: the Autoritat del Transport Metropolità (ATM) sets fares. The 2026 fares came into force on 15 January 2026, and the T-usual monthly pass keeps its 50% discount (ATM).
Fares change during the year, so check the CRTM and ATM websites for the current price before you budget. Madrid is larger and more spread out, so commutes from outer districts can be longer. Barcelona is compact, flat near the sea and easy to cycle, but it is hemmed in by the hills and the coast, which is one reason housing is tight.
Language: Spanish vs Catalan
In Madrid, Spanish is the only official language. In Barcelona, Catalan and Spanish are both official (Statute of Autonomy of Catalonia, article 6). Catalan is the normal language of the regional administration and of public schools.
For work, this matters less than you might think. The jobs on our board are in English. In daily life, almost everyone in Barcelona speaks Spanish, and you can rent, bank and see a doctor in Spanish or, often, English. If you have school-age children and plan to use public schools, expect lessons mainly in Catalan.
Our guide to getting a tech job in Spain without Spanish covers the language question in more detail.
Lifestyle: what people weigh up
These points are not measurable, but they come up again and again:
- Size and pace. Madrid is a big inland capital with a large business district. Barcelona is smaller and on the sea.
- Climate. Madrid has hot, dry summers and cold winters. Barcelona is milder and more humid.
- Tourism. Barcelona gets far more visitors in its centre, which affects some neighbourhoods and short-term rents.
- Community. Both have large international communities and active tech meet-ups.
Visit both if you can. A long weekend in each, looking at flats near your likely office, tells you more than any comparison.
Which should you choose?
Choose Barcelona if:
- your best job offer is there, especially at a product company, gaming studio or start-up;
- you need a sponsored visa and the employers that sponsor are there;
- you want the sea and a smaller city, and the rent works for you.
Choose Madrid if:
- your best offer is at a bank, insurer, consultancy or corporate tech hub;
- you want slightly more take-home pay on the same salary under normal tax rules;
- you prefer a bigger city and don’t mind a longer commute.
Choose either, with a remote job, if you can work from anywhere in Spain. Then compare rent and lifestyle only.
Frequently asked questions
Is Madrid or Barcelona better for expats?
Both have large international communities, and the English-speaking tech job market is similar in size: 694 jobs in Madrid and 767 in Barcelona on Spain Dev Jobs on 16 October 2026. Barcelona has more visa-sponsored jobs and is on the sea. Madrid has lower regional income tax and no rent cap zones. Your job offer usually decides it.
Is it cheaper to live in Madrid or Barcelona?
Neither is cheap, and rent is the main cost in both. INE data shows rents rose 22.6% in Madrid and 24.6% in Barcelona between 2015 and 2024. Madrid leaves you slightly more after tax: on €60,000, our calculator gives €42,184 a year in Madrid and €41,124 in Barcelona. Compare real listings near your office.
Do tech salaries differ between Madrid and Barcelona?
Yes, slightly. The median posted salary on our board was €71,250 in Barcelona and €60,500 in Madrid in October 2026. Levels.fyi showed €64,188 for Barcelona and €55,731 for Madrid on 16 October 2026. Barcelona tends to pay a little more, but higher tax in Catalonia takes back part of the difference.
Is Barcelona or Madrid better to live in long term?
That depends on what you value. Madrid offers a larger job market outside tech, lower regional tax and a central location. Barcelona offers the coast, a milder climate and rent caps on many new contracts. If you have children, note that Barcelona’s public schools teach mainly in Catalan.
How big are Madrid and Barcelona?
According to the official figures for 1 January 2025, the city of Madrid had 3,506,730 inhabitants and Barcelona 1,731,649. Madrid is the largest city in Spain and Barcelona the second. Both metro areas are much larger, and many people commute in from nearby towns.
Do I need to speak Catalan to work in Barcelona?
Not for the jobs on our board, which are in English. Catalan and Spanish are both official in Catalonia, and almost everyone speaks Spanish. Learning some Spanish or Catalan helps in daily life and with paperwork, and Catalan matters more if your children go to a public school.
Next steps
- Browse tech jobs in Madrid and tech jobs in Barcelona.
- Check your net pay in each city with the salary after tax calculator.
- Read our relocation checklist and software engineer salaries guide.
This guide gives general information, not legal or tax advice. Rent rules, tax scales and fares change; check the official sources linked above before you decide.