A comma is used before the word "but" when it connects two independent clauses (each with its own subject and verb) that could stand as complete sentences on their own. For example: "I like coffee, but I prefer tea." A comma is used after "but" only if it is followed by an interrupter, an additional phrase or word that adds qualification, emphasis, or tone within the sentence. For example: "I want to go, but, of course, I have a lot of work." No comma is needed before "but" if it connects an independent clause with a sentence fragment or if the second clause does not stand on its own. Summary:
- Comma before "but" when connecting two complete independent clauses.
- Comma after "but" only when followed by an interrupter.
- No comma if "but" connects an independent clause to a dependent clause or phrase.
These rules also apply to other coordinating conjunctions like "and" and "or".