Have about 4 days. which area would you choose?
they're like apple and orange - can't go wrong with either one, so just pick the easier to get to and save the other for next time.
Madrid, hands-down. Lots to see and do, lots of easy side-trips (Toledo, Segovia, El Escorial), reasonable hotel prices.
As low as Barcelona is on my list, that'd have to be it since the time is about right. You need a heck of a lot more for Madrid and its environs. No sense leaving something half-done - - in either place.
Depends on a lot of factors. Where else will you be in Europe? Barcelona is more accessible to the rest of Europe, unless you plan to fly and then either. Barcelona has beaches and architecture; Madrid has art and day trips. Barcelona is more like France, Madrid is pure Spain. You must decide which best suits your interests. Barcelona can easily be done in 4 days. Madrid can too but with day trips (one of the best advantages of Madrid), 4 days is tight.
With 4 full days, I would choose Madrid. Depending on your interests, the absolute essentials of Madrid can be done in 2 days if in a hurry. That saves a day for a daytrip to Toledo and another for a daytrip to Segovia or El Escorial. You could, of course, spend a lot more time in Madrid. Even if you spend 3 days in Madrid, do a 1 day daytrip to Toledo. Don't miss Toledo, or you'll regret it later.
Personally I would choose Barcelona. Madrid is fine and all but Barcelona simply blew me away. I feel like I could spend several weeks happily wandering around Barcelona, finding new things and exploring all its neighborhoods.
I was actually disappointed in Madrid. I love visiting European cities because the old sections are so wonderful to see. Madrid's old town was so small, I never had a wow moment there like I usually have when I have visited other great European cities. That said I would return for a day since I am a huge art fan and the Prado has 20 or so of the greatest paintings that I have ever seen. What a pleasure it is to see so many great Velasquez, Goya and El Greco paintings. I would return to visit the Prado and then leave the next day. You never (or I never have) hear people talk about Madrid the same way that they do Paris, Rome or for that matter Barcelona.
You are picking among winners! Either is wonderful. I think the poster above has a good point that Madrid is about Spain and Barcelona is more like France. I would pick Madrid unless you feel that you are likely to return when you will be able to explore more of Spain including Madrid.
And then there is Toledo, only 30 minutes away from Madrid. Rather than make a daytrip, I suggest you spend a night there. Go at mid-day from Madrid and return the following day at mid-day. It is a beautiful old city with narrow winding pedestrian streets, where you can get lost but not hopelessly so. It is very pleasant at night after the day-trippers leave.
As with the prior postings, I would choose Madrid if you want to experience Spain. Barcelona is called the Paris of Spain and correctly labled. It is a wonderful city, but Madrid would be my choice. And the overnight trip to Toledo would be on my list as well. The Posada de Manolo, a charming hostal (not of the college student variety) is located near the cathedral and is where I have stayed 3 or 4 times now. Madrid: The Prado, Walking the Gran Via, The Royal Place (don't overlook the armory there as well), Plaza Mayor, and so many other sites to see as well.
If you are on a budget then Madrid would probably be a better choice. Barcelona is said to be the most expensive city in Spain (although it does have a few mercados well located for making picnic meals). In Madrid we found more inexpensive restaurants, also free entrances to various museums.