Short answer
Yes. Using swear words, obscene language and insults is haram. The Prophet ﷺ said the believer is not obscene or foul-mouthed, and that insulting a Muslim is fisq (open sin). This includes the f-word and similar words, whether said in anger, as a joke, in texts or online. If one slips out, seek Allah's forgiveness and train your tongue.
Obscene speech (fuhsh) and insulting others is haram. Insulting a Muslim with abusive words is fisq, and a judge may give a discretionary punishment (ta'zir) for it.
The four schools agree on this.
Explanation
In English, 'swearing' can mean two things: taking an oath, or using bad language. This answer is about bad language. For oaths, see swearing on your mother and Wallahi.
The Prophet ﷺ was never obscene in his speech. He said that the believer does not taunt, does not curse, and is neither obscene nor foul-mouthed, and that Allah hates the obscene, foul-mouthed person. He said: insulting a Muslim is fisq, and fighting him is kufr. The Quran describes the successful believers as those who turn away from ill speech.
What this covers:
- The f-word, s-word and other vulgar words, even used as 'filler'.
- Calling people names: idiot, dog, pig, slurs about their family.
- Sexual jokes and crude descriptions.
- Typing it in chats, comments and gaming voice chat. Writing counts like speaking.
- Singing along to songs full of it.
Saying a bad word does not make you leave Islam, and it is not a valid reason to despair. It is a sin that needs tawbah (repentance). If you hurt a person with it, ask their forgiveness. Some practical steps: notice when you say it most (gaming, driving, anger), replace it with a word you choose in advance, say 'a'udhu billah' when you feel the anger rise, and keep away from content that fills your head with these words.
The Prophet ﷺ warned that a person may say a word without thinking that drops him far into the Fire, and he said: whoever believes in Allah and the Last Day, let him speak good or stay silent. The four schools agree on this ruling. See also is it haram to curse someone.
The evidence
Quran, Surah Al-Muminoon 23:3
وَٱلَّذِينَ هُمْ عَنِ ٱللَّغْوِ مُعْرِضُونَ ﴿٣﴾
And they who turn away from ill speech
Believers turn away from foul and useless talk.
Quran, Surah An-Nisaa 4:148
۞ لَّا يُحِبُّ ٱللَّهُ ٱلْجَهْرَ بِٱلسُّوٓءِ مِنَ ٱلْقَوْلِ إِلَّا مَن ظُلِمَ ۚ وَكَانَ ٱللَّهُ سَمِيعًا عَلِيمًا ﴿١٤٨﴾
Allah does not like the public mention of evil except by one who has been wronged. And ever is Allah Hearing and Knowing.
Allah dislikes vulgar and hurtful speech.
Jami' at-Tirmidhi 1977
Grading to be checked... ليس المؤمن بالطعان ولا اللعان ولا الفاحش ولا البذيء ...
"The believer does not taunt, does not curse, and is neither obscene nor foul-mouthed."
Foul language is not the character of a believer.
Sahih al-Bukhari 48
Sahih... سباب المسلم فسوق وقتاله كفر ...
"Insulting a Muslim is fisq, and fighting him is kufr."
Abusing a Muslim with words is a grave sin.
Jami' at-Tirmidhi 2002
Grading to be checked... وإن الله ليبغض الفاحش البذيء ...
"Allah hates the obscene, foul-mouthed person."
Shows how much Allah dislikes vulgar speech.
Sahih al-Bukhari 6018
Sahih... من كان يؤمن بالله واليوم الآخر فليقل خيرا أو ليصمت ...
"Whoever believes in Allah and the Last Day, let him speak good or stay silent."
The rule for every word a Muslim says.
Where the ruling is recorded
- al-Hidaya, Kitab al-Hudud, chapter on the punishment for false accusation, section on ta'zir. Insulting a Muslim with abusive words earns a discretionary punishment.
- Ihya Ulum al-Din (al-Ghazali), Kitab Afat al-Lisan, section on obscenity and insults. Explains obscene speech and why it is forbidden.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.