is always restrictive in use: it indicates that without what comes after it, you cannot really understand the sentence properly at all. It never takes a comma before it (unless that comma is part of a pair surrounding something else). Which
can be restrictive or nonrestrictive in use. When it is restrictive (which you'll see in print less in North America, where many print publishers' styles say it should only be used nonrestrictively), it is handled exactly like that
. When it is nonrestrictive — when you could take the which
clause out and the meaning of the sentence would be unaltered — it takes a comma before it.
In other words, it is not the words which
that determine whether there is a comma; it is the restrictive or nonrestrictive* nature of the clauses they begin.
I often use a set of examples along this lines:
- The swords that saw battle hung in a place of honour; the rest were cast aside. [that, restrictive, no comma]
- The swords which saw battle were dented and nicked; the rest looked as if they had just been made. [which, restrictive, no comma]
- The returning knights hung their swords, which were dented and nicked in battle, in a place of honour on the hall wall. [which, nonrestrictive, comma]
*You will also see the words essential
used for these same structures.