Barcelona tends to be a safe city in terms of violent crime, as citizens carrying firearms or weapons are illegal, and the local police or “Mossos” are almost everywhere you look.
You will need to watch out for petty crime, though. Pickpockets are abundant and resourceful. They often target tourist havens, like Starbucks coffee shops, public transport, internet cafes, and Las Ramblas (one of the easiest places to have your bag swiped). Simple tips like not looking like a tourist (please, no consulting maps in the middle of the street – sit at a cafe instead), speaking loudly in English, and not wearing your bum bag around your waist (the locals sling them across their chest like a bag) will help a lot.
Whenever possible, try to only take as much cash with you as you need for a day. If you have more than one credit card, leave one at home. Don´t sling your handbag over the back of your chair, especially in crowded places, and always, always, keep your passport as close to your body as possible, if you have to carry it with you at all. Never, ever leave your bag unattended or on the ground next to you in a public place.
Common pickpocket tricks include engaging you in conversation while an accomplice helps themselves to the contents of your bag or nudging you repeatedly in a crowded place and easing open the zip of your handbag or bum bag. The more aware you are, the less likely you will become a victim.
There are no real dangers for women alone in Barcelona, although the Spanish habit of overtly staring and catcalling to women may make many newcomers feel uncomfortable. The best tip for this is to look briefly at the catcaller (a little eye-contact makes you look less of a victim), but not to hold the stare for longer than a moment (sustained eye-contact is seen as a sign of flirting). Traditionally, catcalling is considered a compliment and there is generally no malice in it, although it can be annoying at times. Otherwise, follow the same advice as in any large city: Avoid walking alone in deserted areas at night. Late in the evening, if using the metro, find a car that is not empty; on the bus, sit close to the driver.
A danger worthy of noting is the risk of being run over by a car or scooter. Although the Spaniards are slightly more respectful of pedestrians than Eastern European countries, there is still a ´He Who Holds the Wheel Holds the Road´ attitude to driving. Look both ways, don´t rely too much on the traffic signals, and be prepared to be honked at even when you are doing the right thing.