When do you use a comma before which? The answer is easy.
Yes. You use a comma when the word which introduces a nonrestrictive phrase, which is also called a non-defining clause.
No. You don’t add a comma when which comes before a restrictive or defining clause.
No. There is no comma when which forms an indirect or direct question or is part of a prepositional phrase.
Explaining the comma before which
Which is a relative pronoun and determiner.
We use it when we want to refer to something previously mentioned and then add or introduce more information.
When we do this, we create a nonrestrictive phrase or non-defining clause. These clauses always use a comma before which.
When they occur in the middle of a sentence, they are wrapped in two commas. If it’s the last phrase, there is only one comma.
They are very easy to recognize because you can remove them from a sentence, and the sentence remains complete.
Here are some examples.
White Manor House, which was built in 1843, is an important local monument.
Social networking sites, which are very popular, will definitely change business marketing.
The Caspian Sea, which is the largest inland body of water in the world, lies between Azerbaijan, Iran, Kazakhstan, Russia, and Turkmenistan.
The local mayor will open the new 24/7 medical clinic, which is located on Jarvis Street.
In all these examples, you can remove the clauses in blue because they are not restricted by the sentences. They only add extra information.
White Manor House is an important local monument.
Social networking sites will definitely change business marketing.
The Caspian Sea lies between Azerbaijan, Iran, Kazakhstan, Russia, and Turkmenistan.
The local mayor will open the new 24/7 medical clinic.
When you don’t use a comma with which
In a restrictive or defining clause, there is no comma because it is essential to the sentence.
In many cases, you can replace which with that or even omit the relative pronoun altogether.
The school which (that) she attends is famous.
The meal which (that) I ordered was expensive but delicious.
The school she attends is famous.
The meal I ordered was expensive but delicious.
In this case, you can’t remove the defining clause because you are left with only the subject of the sentence.
No comma with prepositional phrases
If there is a preposition before which, you don’t use a comma.
The house in which I lived as a child was over 100 years old.
The land on which it stood was bought by my great-great-grandfather.
It’s a fond memory to which I often refer.
There are aspects of the plan with which I don’t agree.
Which in questions
In a question, which is an interrogative pronoun. We use it most often to ask questions that relate to a choice.
There is no comma in either the direct or indirect question form.
Which university did you go to?
Which color do you prefer, red or blue?
With which team do you play?
Could you tell me which train goes to Cambridge?
May I ask you which social network you prefer?
Summary of the rules
Deciding when you need to use a comma with which is much easier than for other situations such as the punctuation rules for but.
All you need to do is think about parts of a sentence that use which and add additional information that you can remove. In this case, you need to use a comma.
In all other cases, you don’t need a comma.
The punctuation rules for which are the same as for other relative pronouns such as who, whose, or where.
When you can remove a clause from a sentence using these words, you need a comma.
If they form part of a sentence that you can’t remove, there is no comma. It’s that easy.
Unusually for English grammar, this is a simple rule without exceptions, so you’ll never go wrong again.