Overall, Spain is a relatively safe country, if you compare the total number of crimes committed in Spain to other countries.
Another resource for that is the Eleventh United Nations Survey on Crime trends and the Operations of Criminal Justice Systems .
I can't find a statistic that compares the various cities in Spain, but according to this report , the Costa del Sol is particularly affected by crime, therefore it also has the nickname Costa del Crime.
Also a major German journal states that the Costa del Sol has a very high crime rate, especially Marbella, Torremolinos and Fuengirola.
Maybe this is also because Torremolinos is a very popular party destination for European tourists.
Another Spanish report says that the Costa del Sol is heavily influenced by the Mafia.
According to this site, Barcelona has the highest crime rate of all major Spanish cities whereas Madrid has a relative low crime rate.
So to sum it up, I would say Costa del Sol and Barcelona have a relatively high crime rate, while the rest of Spain is relatively safe compared to European standards, and especially safe if compared worldwide.
travel.stackexchange.com/users/693/RoflcoptrException
(This was a comment but I promoted it to an answer after the question was reopened but before it was reworded to ask about statistics and resources.)
Purely anecdotal evidence but
based on my own personal first hand experience from back in 2002.
Barcelona has more theivery than any other place I've been anywhere in the world, and I've been to every capital city in Central America which has a worse reputation.
I stayed there for over a week and there was not one day
when I did not either witness at least one theft or meet at least one traveller who had been robbed.
Of course I haven't been to every city in Spain
but I saw nothing like it in the other parts of the countries I did go to.
By the way the crime I saw or was told about by the victims I met was certainly not limited to pickpocketing by any means!
I saw a middle aged local lady have her purse snatched by a small boy
and I met two backpacker girls who were grabbed from behind and pulled to the ground whereupon their backpacks were cut off with a knife.
Scamming was also prevalent.
Especially the one where a youth invites you to join in playing soccer with him though the ball is imaginary.
travel.stackexchange.com/users/140/hippietrail
If you are looking for a resource of crime statistics, you can check the website of Eurostat, the statistical office of the European Union.
In a dedicated section, you will find information on crimes in the EU member states and beyond .
Note that the total number of crimes can be broken down by type.
Robbery is one of these types.
Note that these are absolute figures, but with Eurostat's population statistics , you will be able to compute rates.
If you are interested in what is going on in cities, you can have a look at the Urban Audit .
It contains a section on crime.
travel.stackexchange.com/users/None/
Spain don't have any organization or government department that counts or makes crime statistics.
But in Spain there is an Observatorio de la Delicuencia (a universitary agency that is interested in this area).
In 2010, they made public this paper (Spanish) that shows the evolution of criminality in the previous years using police data.
This is the English abstract (the only part in the study that has been written in english): In Spain we do not have periodic victimization surveys since no agency has undertaken this important task.
In order to determine crime levels and trends, national researchers have been forced to focus on official statistics, despite the known weaknesses of these sources.
The present research displays an analysis of the current Spanish criminality, as shown by victimization surveys nationwide.
The longitudinal comparison was made between the two passes (1989 and 2005) of the International Crime Victim Survey (ICVS) in which Spain participated, and polls conducted by the Observatory for Crime in 2009 with the same ICVS questionnaire.
Having these three surveys in sight, we have been able to describe and to assess the evolution of crime in Spain in the last two decades.
As the reader will see through these pages, although public opinion assumes that crime in Spain has increased through the last twenty years, victim surveys for these decades show that crime in Spain has continuously dropped.
If you are very interested, you can use a translator to get a full view of the situation.
If you just only interested to know whether Spain is a safe country, you can go directly to PDF page 3 and see the two charts.
The upper one shows the evolution of criminality from 1980 to 2008.
The other chart shows the population evolution in the same period.
The study concludes that crime is descending in Spain.
Overall, crime in Spain was 47'6 per 1000 inhabitants , less than other european countries:
Sweden: 120.4 United Kingdom: 101.6 Belgium: 94.7 Denmark: 78.8 Germany: 76.3 Netherlands: 75.3 Austria: 73.8 European Union: 70.4 Finland: 64.9 France: 57.5 Luxembourg: 55.7 Italy: 55.6 Spain: 47.6 Greece: 41.2 Portugal: 37.2 Ireland: 25.2 Now, as a Spaniard living in Spain
, I could say that Spain is as safe as any other European country and if you take the minimum safety measures you won't have any problem (don't show money in street, don't use expensive jewellery, etc).
Some areas are more dangerous than others, like Barcelona ramblas, but don't be paranoid, just cautious.
travel.stackexchange.com/users/1425/Ivan
You might want to look at Statplanet .
It is a great resource to compare various indices per country.
There is a section on Crime and Drugs
travel.stackexchange.com/users/None/
Just to confirm that what they say above about high crime rates is not true.
I've been living for more than 20 years in several cities of that area and i could say that you could feel safe walking in the streets almost at any time of day and night.
Of course that there exist places where is better not to go.
travel.stackexchange.com/users/28040/basher
I'm going to visit Spain, and my wife is very worried about thieves in Spain. What cities should we be aware of? Are there any ways to protect myself from them?  eg Barcelona has a reputation for pickpocketing, but is it warranted?
Is there a resource for crime statistics in Spain - especially robbery
travel.stackexchange.com
<safety><spain><security><cities><statistics>
travel.stackexchange.com/questions/464
travel.stackexchange.com/users/19/VMAtm
While Spain does not have an official government body that compiles crime statistics, you can check Urban Audit, Statplanet or Eurostat, the statistical office of the European Union. Overall, Spain is relatively safe compared with other European countries, although there is a lot of theft in Barcelona and you should take basic precautions as in any other place. Barcelona is known to have a massive theft rate and It is advised to take basic saftey meseaures like not wearing expensive jewellery in publib. However, Spain is considered to be as safe as any other european country. But Seeing as the spanish government doesn't provide crime rate statistics,  Eurostat, Urban Audit, Statplanetare are good resources of crime statistics if you are interested.
It is advised to take basic saftey meseaures like not wearing expensive jewellery but Spain is considered to be as safe as any other european country. Barcelona has a massive theft rate. Seeing as the spanish government doesn't provide crime rate statistics, Eurostat, Urban Audit, Statplanetare good resources of crime statistics.