It depends on how long you plan to stay and what activities you would like to do. Generally, it takes about 3-4 days to explore the main attractions of Barcelona.