what is the difference between everywhere and anywhere

Solution 1:

You lose a pair of glasses. You start off by saying:

  • "My glasses could be anywhere." = I don't know where my glasses are. They could be here, there, up, down. In that room, or in another room. I don't know. The glasses are in one of those many different places.

after a few minutes of searching you might say:

  • "I've looked everywhere for my glasses." = I've looked here, there, up, down, in one room, in another but with no luck. Conclusion: I still don't have my glasses.

  • "I know my glasses must be somewhere" = They are not here, there, up, nor down, in one room or in another. But they can't have disappeared. I had those glasses just a minute ago. Where are they?

I ask my wife where my glasses are. She always knows where things are.

  • "Do you know where my glasses are? I can't find them anywhere." = I've looked everywhere but I didn't find them in any of the places I looked.

My wife replies patiently

  • "Yes I do, as a matter of fact, they're on your head."

Solution 2:

Think of the difference between any and every.

any adj 1
1. one, no matter which • can't find any answer.
2. some, no matter which • have you any apples?
[other definitions omitted]

every adj 2
1. each one or single of a number or collection; omitting none.
[other definitions omitted]

any 3
2. used to refer to a person or thing of a particular type when what you are saying is true of all people or things of that type:
- Any child who breaks the rules will be punished.
- Always check the details carefully before you sign any written agreement.
- I can see you any time on Monday.
- If I can help in any way, let me know.

[other definitions omitted]

every 4
1. used to refer to all the people or things in a particular group or all the parts of something:
- We looked carefully at every car that drove past.
- Every child will receive a certificate at the end of the course.
- I enjoyed every minute of the film.
- I listened carefully to every word he said.

[other definitions omitted]

In general terms:

  • any is referring to one or more items, people, or places individually
  • every is referring to all items, people, or places collectively

So you can then apply those prefixes to get the words anywhere, everywhere - anyone, everyone, with the prefixes carrying over their individual meanings. Hence:

  • everywhere = all places
  • anywhere = one or more places

Therefore, when searching for something, you might say:

  • I looked everywhere, ... = I looked in all places
  • ... but I couldn't find it anywhere = I could not find it in any one of the places I looked; I found it in not one (none) of the places.

If you had said "I couldn't find it everywhere", it would have meant "I could not find it in all places (but I did find it in some places)."

So if you have lost a particular item, you look in all places (everywhere), with the hope of finding it in one of the places (anywhere).

In a different situation, such as in a busy city, you might say:

  • "There are cars and people everywhere: there is nowhere that is quiet."
    nowhere = not anywhere

Going back to your original question:

  • I would say that you "use anywhere" when you are referring to a single place, the location of which is immaterial (doesn't matter). [I'm avoiding using "important" because that can have other meanings.]
  • You are correct in suggesting that "anywhere" is often used in a negative clause; e.g. "I couldn't find it anywhere"
  • and also that "anywhere" is often used in a question; e.g. "Is there anywhere (any one place) that I could get a coffee?"

Before answering this question, I looked for any previous questions that had addressed this issue. I couldn't find any, but I did find several previous questions that discussed anyone & everyone. You may find some of those useful:

  • Open for “anyone”? Or open for “everyone”?
  • Difference between “anyone” and “everyone”?
  • What is the difference between “anyone” and “everyone” in this context

This previous question may also be of interest (although it doesn't discuss the word anywhere):

  • His camera accompanied him everywhere/wherever he went in the world.

Solution 3:

The term anywhere is indefinite. No particular place is identified or chosen.

The term everywhere is definite. Every single possible place is identified or chosen.

In your final example, the sentence should read

I lost my glasses. I looked everywhere but I couldn't find them.

because you definitely look in each particular place they might be.

There is also a sense that everywhere suggests multiple incidents of the object or action identified. Anywhere may refer to just one element or multiple elements.

He sowed the grass seed everywhere.

He could have planted that [one] tree anywhere.

He could have planted those[many] trees anywhere

Sometimes they are equivalent.

You can buy my book anywhere.

You can buy my book everywhere.