Following are situations when commas are needed:

Use commas to separate items in a series if there are three or more items. Also, use commas for a list of adjectives which independently describe a noun.
  • Last weekend we did some camping, fishing, and rock climbing.
  • We enjoyed the warm, sunny, beautiful afternoon.
Use a comma with a connecting word (and, but, or, nor, so, yet) when you connect two ideas in a compound sentence.
  • Sam was supposed to be here, but I haven’t seen him all day.
  • She told me to check at the library, so I went there this morning.
Use a comma after the first thought in a complex sentence if the sentence begins with the connecting word. Some commonly used connecting words are if, because, as, when, while, after, before, unless and although.
  • Unless you call me, I will expect to meet you at noon for lunch.
  • Although I dislike crowds, I enjoyed visiting New York City.
Use a comma after an introductory word or phrase, or a transitional word or phrase.
  • After using this product, I will never buy it.
  • For about a week, they didn’t have telephone service.
  • However, the package never arrived.
Exception to the rule above: If an introductory phrase is fewer than four words long, you can leave out the comma after it. (This does not apply to a transition such as therefore, which should have a comma.)
  • On the bus there were about forty musicians.
Use a comma or a pair of commas to set off interruptions in a sentence, especially if the words give unnecessary information and could be left out.
  • My dentist, Dr. Lin, has an office downtown.
  • The weather, according to the TV forecast, is going to get worse tomorrow.
  • Nothing can be done, I think, to save the kitten.
  • They found the missing ring, fortunately.
  • Our neighbor, who works fifty miles away, leaves at 5:00 every morning. (See also Relative Clauses.)
Use commas around a direct contrast (with not) or short question tagged onto a sentence.
  • We should use the word “enthusiastic,” not “arrogant,” to describe the team.
  • You got there on time, didn’t you?
Use commas around an expression such as “she said” or “we replied” when it is attached to a quotation.
  • “You need to go home right away,” said Aunt Fiona.
  • He remarked, “I’d rather not move to Boston, but I feel I have no choice.”