In Simple and Compound Sentences you joined two independent clauses with a coordinating conjunction: for, and, nor, but, or, yet, so (FANBOYS). When one of these words joins two clauses that could each stand alone, a comma goes before it.
Key idea
Comma + and, but, or, so, yet, for or nor joins two independent clauses. If the word after the conjunction is not the start of a new subject and verb (a compound verb), leave the comma out.
Why it works
The comma warns the reader that a second subject is coming. Without it, a reader may misread for a moment: “I painted the fence and my brother painted the shed” starts out sounding as if I painted both the fence and my brother. William Strunk’s fourth rule (1918) was: “Place a comma before a conjunction introducing a co-ordinate clause.”
Worked example: Two clauses
“She ran to the corner and she waved at the bus.”
- Cover the and. Can each side stand alone?
- “She ran to the corner.” Yes. “She waved at the bus.” Yes: it has its own subject, she.
- Two independent clauses, so put a comma before and.
Answer: She ran to the corner, and she waved at the bus.
Worked example: One subject, two verbs
“She ran to the corner and waved at the bus.”
- Cover the and. “Waved at the bus” has no subject of its own.
- It is one clause with a compound verb: ran and waved.
- No comma.
Answer: She ran to the corner and waved at the bus.
Common mistake
Putting a comma before every and: “She ran, and jumped.” Check the words right after the conjunction. A new subject (she, the dog, my brother) means a comma; a verb with no new subject means no comma.
Many style guides let you leave out this comma when both clauses are very short (“I knocked and she answered”). In school writing, using it is always correct.