It is a common misconception that “that” and “which” are completely interchangeable. Not so!
They are used to add information to a sentence and are known as relative pronouns.
But how do you know the correct one to use?
The rule is simple. In a defining (or restrictive) clause, use “that”. In non-defining (or non-restrictive) clauses, use “which”.
And what, you may ask, is a defining clause? It gives information essential to the meaning of the sentence.
For example: “Joe pointed to the foot that was hurt.” In this sentence, “that” introduces essential information about the noun that comes before it – the “foot”.
A non-defining clause introduces information that could be left out of the sentence without affecting the meaning.
For example: “Joe picked up his bag, which contained his packed lunch.” In this sentence, leaving out the clause about the packed lunch results in a sentence that contains less information but still makes sense.
A handy clue is that a non-defining clause is often preceded by a comma, suggesting that the information is supplementary, whereas a comma should not precede a defining clause, suggesting that the information is needed. Simple!