comma before a coordinating conjunction
Whether a comma precedes and, but, so, or another coordinating conjunction.
Place a comma before a coordinating conjunction—for, and, nor, but, or, yet, or so—when the conjunction links two independent clauses. An independent clause has its own subject and verb and is complete enough to end with a period: The bakery sold out by noon, but the café had pastries left. The comma before but marks the start of the second clause.
Use a comma before a coordinating conjunction even when both independent clauses are short: Ana sang, and Leo played. (Many people omit the comma between short clauses, but we recommend it.)
Whether a coordinating conjunction takes a comma depends on whether the words after it have a subject of their own. In The inspector measured the beam, and she photographed the crack, the pronoun she is the subject of the second clause, so that clause is independent, and a comma precedes and. Delete she, and the inspector becomes the subject of both measured and photographed. Two verbs that share one subject form a compound predicate, which takes no comma before the conjunction: The inspector measured the beam and photographed the crack. Two commands joined by a coordinating conjunction take no comma either, because both verbs share the understood subject you: Seal the envelope and mail it by Friday.
Always put a comma before for when it is used as a coordinating conjunction. Without the comma, readers may mistake the conjunction for a preposition: The ferry stayed in port, for the harbor had frozen.
When a coordinating conjunction links single words or phrases rather than clauses, no comma precedes it: The tour runs on Tuesdays or Thursdays. The lecture was long but engaging.
A comma between two independent clauses, with no conjunction after it, produces a comma splice: The printer jammed, the meeting started without handouts.
See also comma; comma splice / run-on sentence; compound predicates: comma use; contrasting phrases: comma use; Oxford comma (serial comma).
Examples
Use The gallery extended its hours, so the guards worked a later shift. (Each side of so has its own subject and verb, so a comma comes before so.)
Avoid The landlord approved the repairs but the tenants had already moved out. (The comma before but is missing. The tenants had already moved out has its own subject and verb, so but joins two independent clauses and needs a comma before it. Write The landlord approved the repairs, but the tenants had already moved out.)
Avoid The landlord approved the repairs but, the tenants had already moved out. (The comma after but is misplaced. The comma that separates two independent clauses goes before the conjunction, not after it. Write The landlord approved the repairs, but the tenants had already moved out.)
Use The archivist scanned the letters and labeled each folder. (The archivist is the subject of both scanned and labeled, so and takes no comma here.)
Use The bridge was not finished, nor had the road been paved. (Nor joins two independent clauses here, so a comma comes before it.)