If you hold a passport from one of the European Union countries then you do not need a visa.
If you are from the United States, Canada, Australia, Israel, New Zealand, Norway, Switzerland or Iceland you can stay up to 90 days without a visa.
If you are a citizen from another country, check with your local Spanish consulate or embassy. You can find a list at the Spanish Ministry of Foreign affairs.