I think he's doing it for two reasons ~ attention and peer pressure. Many men (young and old) think it makes them look cool to swear; and today, it is even considered a 'cool' thing to do (and I'm shocked by how many young girls now talk this way too). Look at the movies and television -- swearing more than ever before. Swearing also gives him a way to be different from you; kids are going into puberty much earlier today than before, so this is likely what I call the pre-teen phase -- pushing the envelope to see how far he can go.
Firstly, I would sit him down and give him the talk: explain how you do not approve and are not impressed or proud of him for the way he is talking these days (for some kids that would work); and that others will not be impressed with a filthy mouth either (ie gramma and grampy, or any other adult he admires).
Also make sure there isn't something else bothering him, like a bully at school or trouble with a teacher; or problems with his schoolwork or any other thing that can cause anger in a child (ie speaking of abuse). Swearing can also be a sign of UNRESOLVED ANGER.
I take it you may have done this already, and he's persisting, so on to disciplinary measures ...
Taking away priviledges is the best way with this age group: start small though ... make the discipline suit the crime.

Start with one night no TV or WII games or Xbox or Computer or whatever else he loves; and work your way up, if he continues (ie the weekend; then a week). For some kids having them do chores works, but for most losing privileges works better. No movie night; no seeing friends this Friday night, and so forth.
BTW, this is the method professionals use in group homes for troubled teens where I worked as a counsellor (I'm a retired Social Worker). You know your son best, so you will know what things he would hate to lose. Keep it simple, but be consistent; don't cave and don't give in.
By starting small (one night), it will be perceived as 'fair' in your son's eyes. If a parent 'OVERPUNISHES' the kid gets frustrated and won't try or listen; and just gets angry. By being FAIR, but consistent, you maintain their respect while teaching them that rude talk or behavior will always have consequences ...
Good luck ...