There is a version of this question that has no answer, because the two cities are not competing for the same visitor. Barcelona has the sea, a body of architecture unlike anywhere else on earth, and the visitor numbers that come with both. Madrid has the three best art museums in Spain standing in a row, a bar culture that operates on local time, and the particular quality of being a major capital that has not been reorganised around tourism. What follows is what each one is actually better at.

What Barcelona is better at

The sea, which is a genuine structural advantage and settles most summer afternoons.

Architecture, where the modernista buildings are without parallel and worth the trip on their own.

Compactness, with the old city, the beach and the main sights close together.

Immediate impact, because it looks extraordinary from the first hour.

Fine dining, with a deeper and more internationally known restaurant scene.

Day trips to the coast, which are easy and beautiful.

What Madrid is better at

Art, decisively, with three world class collections within a fifteen minute walk of one another.

Eating cheaply and well, particularly at lunch, where nothing in Barcelona competes on value.

Bar culture, which is denser, later and less curated.

Crowds, in the sense of having fewer of them at the same time of year.

Football, with two top division clubs and the largest club museum in Spain.

Feeling like Spain, rather than like a destination, which is the thing people notice on a second visit.

Practical differences that matter

Climate: Madrid is inland, dry and extreme, freezing in January and around forty in July; Barcelona is coastal, milder and more humid.

Language: Catalan is co official in Barcelona and part of the identity there; Spanish is universal in both.

Pickpocketing: a serious problem in both, and worse in Barcelona by most measures.

Airport transfers: both are easy on public transport, Madrid’s is a straightforward metro or bus ride.

Beaches: Barcelona has them; Madrid has a river park and municipal pools.

Accommodation prices: consistently lower in Madrid for a comparable room.

Madrid rooftops and the sierra beyond, seen from a high terrace, Spain

How to choose in one line

Want a beach? Barcelona.

Want the Prado? Madrid.

Travelling in July or August? Barcelona, for the sea.

Travelling in November? Madrid, because Barcelona out of season loses the thing it does best.

Second trip to Spain? Madrid.

Four nights only? Whichever one you will not resent skipping.

Where this fits in a Madrid trip

If you have landed on Madrid, the rest of the decision is about how to use the days.

For the practical shape of a first visit here, our first time guide to Madrid covers the ground.

For a ready made structure, our four day Madrid itinerary covers what to put where.

And for the thing Madrid genuinely does better than its rival, our guide to football tickets in Madrid covers both clubs.

A high speed train waiting at a platform in Spain

The short version

Barcelona for the sea, the architecture and the immediate impact. Madrid for the art, the food value, the bar culture and the smaller crowds. Barcelona in high summer because the beach solves the afternoon; Madrid in winter because it does not depend on the weather. If you have a week, do both and take the train, which is under three hours and easier than either airport. And if you only have four nights, choose one and do it properly rather than splitting it.