Denver lawyer David Lane has said, “The First Amendment lives in a rough neighborhood and if you can’t stand the neighborhood move to China … or somewhere the First Amendment does not exist.”
"One man's vulgarity is another's lyric." Cohen v. Cali. 403 U.S. 15, 25 (1971)
At this point, we need to define illegal as used in your question. For instance, do you mean "you can face any form of punishment"? If so, this question is extremely broad and governed by multiple sets of laws.
Additionally, one should note that this is a Federal Question. The First Amendment, through the Due Process clause applies to states as well. Therefore, there will be extremely little discrepancy (if any - first impression issues being the main differences probably) between the States,.
The FCC can limit profanity on air. Additionally, Title 18 of the United States Code, Section 1464, (Whoever utters any obscene, indecent, or profane language by means of radio communication shall be fined under this title or imprisoned not more than two years, or both.
) prohibits the utterance of any obscene, indecent or profane language by means of radio communication.
The USPTO can limit Trademarks with "vulgar" meaning. (See EDIT below for update.)
High school student's First Amendment rights were not violated in suspension for uttering obscenity, regardless of whether she was merely repeating and returning words originally directed at her, particularly where words were clearly disruptive as they were heard by 90 students in cafeteria and, in opinion of assistant principal, were “fighting words.” Heller v. Hodgin, S.D.Ind.1996, 928 F.Supp. 789.
Fighting Words: These seem to be words that would invoke, or are likely to invoke a fight.
Fighting words claim upheld:
Arrestee's speech when crowd gathered near fallen tree that had blocked traffic constituted unprotected fighting words, so that his arrest under city disorderly conduct ordinance did not violate his First Amendment free speech rights; arrestee's repeated use of the word “bitch,” his accusation of matricide directed toward his sister, his use of the phrase “fucking queer,” his pushing of third party and his raised voice all tended to show that his conduct, under the circumstances, had tendency to provoke physical altercation.
Fighting words claim not upheld:
Detainee's profane words to police officer as officer conducted Terry stop, “son of a bitch,” while unpleasant and insulting, were not “fighting words,” given officer's confirmation of fact that words did not cause anyone to fight or become angry; thus, words could not constitute violation of disorderly conduct statute and in turn could not supply probable cause for disorderly conduct arrest.
In addition to fighting words, true threats and incitement to imminent lawless action are not protected under the First Amendment.
Additionally, the government can regulate free speech in public schools (hence Free Speech Zones) and while in their employ (no yelling at your boss if you want to keep your job).
It is not part of the main question, but free speech inside the court room. Well, the Judge is pretty much king in a courtroom. What he says goes. (more or less, like nothing toooooo crazy). In a courtroom, if you do something a Judge doesn't like, he can hold you in contempt of court. (You get no jury for contempt cases.)
EDIT: Since I wrote this answer, new law came out from the Supreme Court in
Matel v. Tam, 582 U.S. ___ (2017). The Supreme Court affirmed the finding of the Federal Circuit that the disparagement clause [is] facially unconstitutional under the First Amendment’s Free Speech Clause.
Simon Tam, lead singer of the rock group “The Slants,” chose this moniker in order to “reclaim” the term and drain its denigrating force as a derogatory term for Asian persons. Tam sought federal registration of the mark “THE SLANTS.” The Patent and Trademark Office (PTO) denied the application under a Lanham Act provision prohibiting the registration of trademarks that may “disparage . . . or bring . . . into contemp[t] or disrepute” any “persons, living or dead.” 15
U. S. C. §1052(a). Tam contested the denial of registration through the administrative appeals process, to no avail. He then took the case to federal court, where the en banc Federal Circuit ultimately found the disparagement clause facially unconstitutional under the First Amendment’s Free Speech Clause.
The decision aptly concludes with: "If affixing the commercial label permits the suppression of any speech that may lead to political or social “volatility,” free speech would be endangered."