If flying into Madrid, what is best way to get to Barcelona? If flying, how much time needed to connect between planes?
The AVE is a high-speed train line connecting the two cities in a little under 3 hours. It beats flying in my book. You can find information on it at https://www.raileurope.com/european-trains/ave/how-to-book.html
There are flights and there are high speed trains.
If you are flying in from somewhere else and already at the airport, it might be faster to fly another leg to BCN. If you are staying in the city of Madrid first for a few days, then going to Barcelona, then, city center to city center, the train is definitely faster.
If flying, the time needed for a flight connection depends on where you are coming from (within EU Schengen or from outside EU), and whether you are flying on one ticket, which usually means that the bags are forwarded to the last destination for you. If that is the case, a couple of hours should be sufficient.
But If you fly with separate tickets, you need to retrieve luggage, then walk to the check in of the airline you fly to BCN. That will require additional time. Also, if flying with a low cost airline deal, those tickets may be non refundable, therefore you may want to have sufficient cushion in case of flight delay.
Best way means different things depending on situation. Roberto hit the high points very well.
I vote for the AVE train. If you are flying into Madrid, get the Airport Express bus just outside the terminal, to the right. It is a 5 euro trip, and it only stops two places once you leave the airport - Cibeles, and Atocha train station (takes about 30 minutes). Then it's less than 3 hours to Barcelona on the train, which is spacious and comfortable, even in Turista class. You can buy extremely discounted tickets about 60 days out. I paid 39 euros for a normally 130 euro trip by buying early.
Thanks for the responses everyone, since we're flying in the same day, we decided to take a plane top fly onto Barcelona. We booked a round trip from the US into Madrid since Madrid is where we end up on our trip. Thanks again.
For future reference, you could have booked a multi-city (open-jaw) trip into Barcelona and out of Madrid. Doing that avoids having to guess how much time between flights is safe.