Getting Tourist visa, student visas and other work and residency permits for Barcelona. Visitors from the European Union, Switzerland, Norway, Iceland, or Liechtenstein don't need a visa to visit or to work and live in Spain. To visit Barcelona they just their own national ID or a current passport . For minors, the national ID or passport must be accompanied by written parental permission.
Visitors from Andorra, Argentina, Australia, Bolivia, Brazil, Brunei, Canada, Chile, Costa Rica, Croatia, El Salvador, the United States, Guatemala, Honduras, Israel, Japan, Malaysia, Mexico, Monaco, Nicaragua, New Zealand, Panama, Paraguay, the Republic of Korea, Romania, San Marino, the Vatican, Singapore, Uruguay, or Venezuela do not need a tourist visa to visit Spain, and can stay for up to 90 consecutive days with a valid passport from their home country.
Visitors from all other countries and nationalities must apply for a tourist visa from the Spanish Consulate in their home country.
As mentioned EU citizens have automatic right to live and work in Spain, but other nationalities must apply for long term student visas or employment and resident permits.
Contact your local Spanish Consulate or the visit the page below for information on different types of visas for Spain
List of Spanish Embassies and Consulates
Spanish Immigration ministry website