When to use 'that' and 'which'

How do you know when to use that ir which. For exapmle, the definition of reality is everything that exists. Can we say everything which exists too?

Is there any specific rules or is it individual mostly?

Thanks

.
The rule is that that and which can be used for restrictive clauses and which is used for non-restrictive clauses:

Reality is everything that/which exists.
My dog has been found, which comforts me
.

Many grammarians consider that which cannot be used for restrictive clauses, so you would be wise to stick to that.

Here is what the American Heritage Dictionary has to say:

USAGE NOTE: The standard rule requires that that should be used only to introduce a restrictive (or defining) relative clause, which identifies the entity being talked about; in this use it should never be preceded by a comma. Thus, in the sentence The house that Jack built has been torn down, the clause that Jack built is a restrictive clause identifying the specific house that was torn down. Similarly, in I am looking for a book that is easy to read, the restrictive clause that is easy to read tells what kind of book is desired. A related rule stipulates that which should be used with nonrestrictive (or nondefining) clauses, which give additional information about an entity that has already been identified in the context; in this use, which is always preceded by a comma. Thus, we say The students in Chemistry 101 have been complaining about the textbook, which (not that) is hard to follow. The clause which is hard to follow is nonrestrictive in that it does not indicate which text is being complained about; even if the clause were omitted, we would know that the phrase the textbook refers to the text in Chemistry 101.

•Some grammarians extend the rule and insist that, just as that should be used only in restrictive clauses, which should be used only in nonrestrictive clauses. Thus, they suggest that we should avoid sentences such as I need a book which will tell me all about city gardening, where the restrictive clause which will tell me all about city gardening indicates which sort of book is needed. But this extension of the rule is far from universally accepted, and the use of which with restrictive clauses is common. Furthermore, since that cannot be used with clauses introduced by a preposition (whether or not restrictive), which is used with both clauses when such a clause is joined by and or or to another that does not begin with a preposition, as in It is a philosophy in which the common man may find solace and which many have found reason to praise. Such constructions are often considered cumbersome, however, and it may be best to recast the sentence completely to avoid the problem.
.

Hi anoopbal,

Just to add a bit more information I would like to draw your attention to some material I’ve written on this topic for the site:

English Grammar Lesson: Relative Pronoun
[size=75]http://www.english-test.net/lessons/21/index.html[/size]

English Grammar Lesson: Relative Pronoun (2)
[size=75]http://www.english-test.net/lessons/22/index.html[/size]

English Grammar Lesson: Relative Pronoun (3)
[size=75]http://www.english-test.net/lessons/23/index.html[/size]

A

Thanks a lot for taking the time to reply.

A few questions more:

  1. The book on the top shelf is mine. Or the book that is on the top shelf is mine. Which sentence is grammatically correct. Both sounds right to me.

2)Also the sentence, my dog has been found, which comforts me. Is comma neccassary there bcos I read it the same way even without the comma.

Thanks again