The nation of Spain has a highly developed social market economy. It is the world's 12th largest by nominal GDP and the sixth-largest in Europe (fifth excluding Russia). Spain is a member of the European Union and the eurozone, as well as the Organization for Economic Co-operation and Development and the World Trade Organization. In 2024, Spain ranked as both the 17th-largest exporter and the 17th-largest importer in the world. Furthermore, Spain is listed 28th in the United Nations Human Development Index and 30th in GDP per capita by the International Monetary Fund. Some main areas of economic activity are the automotive industry, medical technology, chemicals, shipbuilding, tourism and the textile industry. Among OECD members, Spain has a highly efficient and strong social security system, which comprises roughly 23% of GDP.
During the Great Recession, Spain's economy was also in a recession. Compared to the EU and US averages, the Spanish economy entered recession later, but stayed there longer. The boom of the 2000s was reversed, leaving over a quarter of Spain's workforce unemployed by 2012. In aggregate, GDP contracted almost 9% during 2009–2013. In 2012, the government officially requested a credit from the European Stability Mechanism to restructure its banking sector in the face of the crisis. The ESM approved assistance and Spain drew €41 billion. The ESM programme for Spain ended with the full repayment of the credit drawn 18 months later.