“That” is used for essential information, while “which” can be use for either essential or non-essential information.
- “That” is used for essential information.
- “Which (preceded by a comma)" is used for non-essential information.
- “Which (not preceded by a comma)" is used for essential information.
(1) “That” with a clause containing essential information (restrictive clause):
The cookies may include ingredients that are allergens.
A restrictive clause contains essential information that cannot be taken out of the sentence. Here “that are allergens” is essential information in the sentence. If you took out the clause, the sentence would not convey that there are allergens in the cookies:
The cookies may include ingredients.
With common sense, we can deduce that cookies do contain ingredients, so the sentence without the clause may seem quite meaningless.
Note that “that” clauses are not accompanied by commas. The following sentence would be incorrect:
Incorrect: The cookies may include ingredients, that are allergens.
(2) “Which” (preceded by a comma) with a clause containing non-essential information (non-restrictive clause):
The cookies, which took a while to bake, were delicious.
A non-restrictive clause contains non-essential information that can be taken out of the sentence. If we were to take out the non-restrictive clause, “which took a while to bake,” from the sentence above, the sentence would still be grammatically correct.
The cookies were delicious.
Whether the clause is essential or non-essential may seem highly subjective to a listener or reader, so the speaker or writer of the sentence is to determine whether the clause is essential to the point they are making. The speaker or writer will convey whether the information is essential or not by their choice of “that” or “which” with or without a comma.
(3) “Which” (not preceded by a comma) with a clause containing essential information (restrictive clause):
The cookies which are in the oven will need another 10 minutes.
In this sentence, the writer decided that “which are in the oven” is essential information in the sentence. The writer wanted to specify which cookies he, she, or they were talking about. Although the sentence is grammatically correct without the clause, the writer has determined that this is essential information that must be conveyed.
As determiners, “that” and “which” may seem interchangeable at first, but just remember that “that” and “which” without a comma are for restrictive clauses with essential information while “which” with a comma or commas is for non-restrictive clauses with non-essential information.
Compare the following sentences.
The building that you are looking for is over there.
The building, which you are looking for, is over there.
The building which you are looking for is over there.
The first and last sentences deem the clause as restrictive with essential information that cannot be taken out. Meanwhile, the second sentence shows that the clause is non-restrictive with non-essential information.