From Word Genius
I went to the store a while ago.
OR
I went to the store awhile ago.
Which is correct?
I went to the store a while ago is correct.
Why?
This is a tricky one because both the singular “awhile” and the two-word phrase “a while” have very similar meanings. The adverb “awhile” means “for a period of time,” and the noun phrase “a while” means “a period of time.”
When in doubt about which one to use, there are a few tricks to try. If the phrase “for a while” can be substituted in the sentence, then the correct word is the adverb “awhile.” Example: “I cleaned awhile” means the same thing as “I cleaned for a while.” On the other hand, “I went to the store for a while ago” doesn’t make sense, which means the correct version uses the noun phrase “a while,” as in, “I went to the store a while ago.”
To check whether the noun phrase “a while” is correct, try substituting a specific amount of time, such as “an hour” or “a week.” Example: “I went to the store a while ago” correctly turns into “I went to the store an hour ago.”
Let’s Make It Even Clearer
From Merriam-Webster Dictionary
Awhile is an adverb that means “for a while,” whereas “while” is a noun meaning “a period of time.” Generally, the two-word form “a while” should be used when following a preposition (“I will read for a while”), or with the words ago or back (“a while ago/back”). Awhile should be used to modify a verb (“I will wait awhile”) and can usually replace any usage of “for a while.”
A long forgotten trick on when to use “a while” or “awhile”. Thanks for the reminder!