4 days is the ideal amount of time to spend in Barcelona. This allows for leisurely exploring of the city, visiting the most popular spots and even spending a few hours at the beach.