Barcelona is generally safe, but as with any overcrowded touristy metropolis, you should take some precautions so your vacations don’t get ruined.
Pick pocketing and bag snatching is a problem on the Ramblas, at rail stations, on the beaches and on the metro (subway), as well as other crowded places. Avoid dropping your bag on the floor or hanging on the chairs at cafes and restaurants.
Some areas of the city are safer than others, especially at night. The safest zones are those with few tourists, because crime follows the jet-lagged, unaccustomed traveller. The safest areas are L’Eixample and Gràcia. The least safe are El Raval and the Gothic Quarter.
At night avoid walking alone in the dark, empty streets.