Commas can be wildly confusing, and the grammatical rules around them are many. Here are the times you’re going to put them in your writing, and how to do it correctly:
Use a comma before any coordinating conjunction linking two independent clauses
A coordinating conjunction is a word such ‘and,’ ‘but,’ ‘for,’ ‘or,’ and ‘yet’ used to connect clauses.
“Johnny likes apples, but he does not like oranges.”
“The building is simple, yet it is striking.”
Here, the clauses are connected. Thus comma is used.
If you remove the subject from either clause, however, a comma is no longer needed:
“He likes apples but not oranges.”
“The building is simple yet elegant.
Use a comma after a dependent clause beginning a sentence
A dependent clause is a clause with both a subject and verb, but which is not itself a full sentence.
“Though Johnny likes apples, he does not like oranges.”
“While it is simple, the building is striking.”
But if the dependent clause ends the sentence, no comma is needed.
Use commas to section out appositional, and negative clauses from the rest of the sentence
An appositive clause acts synonymously with or elaborates on another clause. A negative clause does the same thing but serves as a counterexample to the clause it describes.
“Though Johnny likes apples, especially tart ones, he does not like oranges.”
“While it is simple, having no complex structural elements of offshoots, the building is striking.”
But be careful. Don’t use commas to section off info essential to the sentence. If a clause starts with ‘that’ or ‘which,’ that clause is probably a necessary part of the sentence and should not be separated.
Use commas to separate lists of items or lists of adjectives that describe the same noun.
“Johnny likes apples, pears, watermelons, and pomegranates.”
“The building is simple, tall, and grey.”
Lists are pretty straightforward as far as the grammar rules of commas go, but often the final comma in a list (AKA the Oxford comma) can be tricky to use correctly. Find out more about it in a previous article on the subject here.
Use commas after introductory adverbs, affirmations/negations, and names
“Johnny likes apples. However, he does not like oranges.”
“Yes, the building is simple yet striking.”
“Johnny, that simple and yet striking building is shaped like an apple.”
These introductions direct and change the context of a sentence. Adverbs generally end in ‘-ly’ and describe the way something occurs. Words like ‘however’ and ‘furthermore’ at the beginning of a sentence also are followed by a comma as they relate the manner of one thing to the manner of another. ‘Yes,’ and ‘no’ and names work in virtually the same way.
Use it commas when quoting
Whether the comma is inside or outside the quotations depends on the order of the sentence.
If the quote comes first, it goes inside.
” ‘I like apples,’ said Johnny ”
If the attribution comes first, it goes outside.
“The townspeople said, ‘The building is simple yet elegant.’”
That will cover any time you need to make a quote.
Finally, use commas to separate elements in an address, in the date, when defining a location by multiple parameters, and in the thousand places when writing large figures numerically.
Here are some examples of usage in these contexts:
“P. Sherman, 42 Wallaby Way, Sydney, Australia.”
“I live in Madison, WI, United States of America.”
“The next Groundhog Day is on Saturday, February 2, 2019.”
This is all reasonably self-explanatory except the rule that you may skip the comma when only listing the month and year of an event.
Like all complicated rules, this will take a while to remember. But by consistently making an effort to employ commas correctly, your writing will quickly become more natural to read, and it will sound more professional.