Writers often wonder: is a comma needed before which? Short answer: use a comma only when the which-clause is nonrestrictive-when it adds extra information you could drop without changing which thing you mean. Omit the comma when the clause is restrictive and identifies the noun.
Below: a concise rule, three fast tests, many real-world wrong/right pairs (work, school, casual), copy-paste rewrites, editing mnemonics, spacing traps, and a quick FAQ.
Quick answer
Put a comma before which only if the clause is nonrestrictive-that is, it provides extra information that can be removed without changing what you mean. If the clause identifies which one, do not use a comma; in formal American usage prefer that for restrictive clauses.
- Nonrestrictive = comma + removable detail. Example: The book, which is red, is mine.
- Restrictive = no comma (or use that). Example: The book that has a red cover is mine.
- Fast test: remove the which-clause. If meaning changes, omit commas.
Core rule (short)
Nonrestrictive clause = extra, parenthetical information → set off with commas. Restrictive clause = necessary information to identify the noun → no commas.
- If you can remove the clause and still point to the same item, add commas.
- If removing the clause changes which item you mean, omit commas (or use that).
- In American formal writing, many editors prefer that for restrictive clauses and which (with commas) for nonrestrictive ones; meaning is still the primary test.
Three quick tests to decide in seconds
Run these tests in order: Remove, Replace, Ask.
- Remove: delete the which-clause. If the sentence still identifies the same thing, it's nonrestrictive → add commas.
- Replace: swap which for that. If the sentence reads correctly with that (no commas), it's probably restrictive in American usage.
- Ask: does the clause tell you which one among many? If yes, do not use commas.
- Example: Original: The phones which arrive late are under warranty. Remove clause: The phones are under warranty. (Meaning changed: restrictive → no comma / use that.)
Examples you'll actually write (work, school, casual)
Each pair shows the mistaken sentence, why it's wrong, and a corrected version you can use.
Work
- Wrong: The contract, which expires next month must be renewed. Why: Clause identifies which contract.
Right: The contract that expires next month must be renewed. - Wrong: The vendor, which supplies office chairs, missed the delivery deadline. Why: Clause adds extra info.
Right: The vendor, which supplies office chairs, missed the delivery deadline. - Wrong: Please review the report which I attached and send comments. Why: Clause identifies which report.
Right: Please review the report that I attached and send comments.
School
- Wrong: The experiment, which showed surprising results will be repeated. Why: Clause identifies which experiment.
Right: The experiment that showed surprising results will be repeated. - Wrong: Her dissertation which explores three regions won the award. Why: Clause is extra detail.
Right: Her dissertation, which explores three regions, won the award. - Wrong: Books which include primary sources are preferred for the class. Why: Clause restricts which books.
Right: Books that include primary sources are preferred for the class.
Casual
- Wrong: My laptop, which I bought used last year still runs fine. Why: Clause adds extra info.
Right: My laptop, which I bought used last year, still runs fine. - Wrong: The cupcakes which have sprinkles are gone. Why: Clause picks out certain cupcakes.
Right: The cupcakes that have sprinkles are gone. - Wrong: Our office which has the rooftop garden is open this weekend. Why: Clause is extra detail.
Right: Our office, which has the rooftop garden, is open this weekend.
How to fix your sentence: quick rewrite recipes
Choose the rewrite that matches your intent: identify or describe?
- If you meant to identify (restrictive): remove commas and use that (American): The files that contain errors need fixing.
- If you meant to add detail (nonrestrictive): add commas around the clause: The files, which contain minor notes, are archived.
- If punctuation looks awkward: rephrase to avoid the relative clause: Files containing errors need fixing.
- Original: The proposal, which was revised yesterday will be presented. Fix: The proposal, which was revised yesterday, will be presented. (Add missing comma.)
- Original: The interns which worked late finished the project. Fix: The interns who worked late finished the project. (Use who/that; no commas.)
- Original: The dataset which contains errors needs cleaning. Fix: The dataset that contains errors needs cleaning. Or: Datasets containing errors need cleaning. (Two fluent options.)
- Original: The manager, which approved the plan is on leave. Fix: The manager who approved the plan is on leave. (Remove comma; clause is restrictive.)
Try your own sentence
Test the whole sentence in context. Often context makes the right choice obvious.
Memory tricks and editing cheats
Quick mnemonics to use when you edit under time pressure.
- 'By the way' test: insert "by the way" before the clause. If it fits, the clause is nonrestrictive → use commas.
- 'Remove it' test: if removing the clause keeps the same referent, use commas.
- 'Which = extra; that = essential' (American quick rule) - when in doubt in formal writing, use that for necessary clauses.
- Example mnemonic: The car, by the way, which was in the lot, is ours - the clause is parenthetical (nonrestrictive).
Hyphenation, spacing, and small punctuation traps
Formatting problems can hide or create comma errors. Check spacing and comma placement before finalizing text.
- Always put exactly one space after a comma. A missing space can make a comma invisible.
- Never put a space before a comma.
- Avoid inserting commas between subject and verb; set commas around an interrupting which-clause, not between subject and verb.
- If punctuation feels crowded, rewrite the sentence rather than stacking commas, parentheses, and dashes.
- Bad: 'The report,which was signed,was filed.' Good: 'The report, which was signed, was filed.'
- Bad: 'The manager, which approved the plan is on leave.' Good: 'The manager who approved the plan is on leave.'
Grammar corner: similar mistakes to check too
When you check which/commas, also check these related issues.
- Which vs that: choose by meaning; many American style guides recommend that for restrictive clauses.
- Who vs that: use who for people (The teacher who assigned the homework).
- Appositives (nouns that rename another noun) need commas if nonrestrictive: My supervisor, a former scientist, approved the budget.
- Watch legal and technical writing: missing commas can change the scope of obligations.
- Wrong: The teacher, that assigned the project, is new.
Right: The teacher who assigned the project is new. - Appositive: 'Edison, an inventor, lived in New Jersey.' (Commas because the noun is extra info.)
Real usage: American, British, and casual tone
Meaning is universal; style varies. In formal American writing prefer that for restrictive clauses. British English accepts which more freely. Casual writing may drop commas, but ambiguity in formal documents is risky.
- Business/legal: use strict rules (often that for necessary clauses) to avoid ambiguity.
- Academic: follow your style guide (APA, Chicago, MLA) and be consistent about which/that and commas.
- Casual: prioritize clarity-if skipping commas creates doubt, add them.
- Legal example: 'The goods which are listed in Appendix A are excluded' vs 'The goods, which are listed in Appendix A, are excluded'-the comma changes whether the exclusion applies to all goods or only those in Appendix A.
- British example: 'The car which was blue belonged to her.' (Often acceptable; still check whether you mean extra info.)
FAQ
Do I always need a comma before which?
No. Use a comma only when the which-clause is nonrestrictive-extra information you can remove without changing which thing you mean.
Is which vs that a hard rule?
Meaning is the primary rule. In American formal writing, that is preferred for restrictive clauses; British usage is looser. When unsure, rephrase or follow your style guide.
How can I test a sentence quickly?
Delete the which-clause. If the sentence still identifies the same thing, it's nonrestrictive → use commas. If deleting it changes which thing you mean, omit commas (or use that).
Can commas change legal meaning?
Yes. In contracts and legal documents, commas can alter the scope of provisions. Use precise punctuation and consult legal editors when meaning affects liability.
Should I prefer rewrites over commas?
Often yes. When punctuation becomes heavy or unclear, rephrase the sentence: e.g., 'Files containing errors need fixing' instead of a long which-clause.
Want a quick check?
If you hesitate between comma or no comma, run the sentence through a grammar checker to flag restrictive vs nonrestrictive uses and offer simple rewrites you can accept or edit.