This sheet is only a guide to the most common, and most commonly misapplied, uses of commas. For a full guide to using commas, consult a writing handbook.
1. Use a comma with a coordinating conjunction to join two full sentences.
Tommy went to the store, and he bought a gallon of milk.
2. Use a comma and a semicolon with a subordinating conjunction or other transitional element to join two full sentences
Tommy went to the store; moreover, he bought a gallon of milk.
Tommy went to the store; as a matter of fact, he bought a gallon of milk.
3. Use a comma to set off an introductory phrase or a subordinate clause at the beginning of a sentence.
When Tommy went to the store, he bought a gallon of milk.
Having gone to the grocery store, Tommy bought a gallon of milk.
*Note that a subordinate clause at the end of the sentence does not need a comma:
Tommy bought a gallon of milk when he went to the store.
4. Use a comma between all items in a series.
Tommy went to the store to buy a gallon of milk, a carton of ice cream, and a box of cookies.
** The comma before the “and” is known as the Oxford Comma. I prefer it, because it prevents ambiguity, but I won't be legalistic about it as long as you are consistent in your use.
5. Use commas to set off nonrestrictive (i.e., not logically necessary) elements.
Tommy went to Kroger, a grocery store, to buy a gallon of milk.
** Note that if those elements are necessary to the understanding of the sentence (restrictive), you do not use them:
Tommy went to the grocery store where his mother worked to buy a gallon of milk.
6. Use commas to prevent confusions or misreadings
** This is the place where most comma misusages come from, so beware of this category. Two of the most common reasons to use a no-confusion comma are given below; the other way to tell when a comma might be necessary is to read the sentence aloud. If you have to pause between words to let the sentence make sense, you may need a comma there.
Tommy went to the store, or so I was told, to buy milk.
Tommy went to the store to buy milk, not bread.