Recently a student asked a great question about the difference between "awhile" and "a while". These words can be tricky so let's look at how to use the two.
The two-word expression a while is a noun（名詞）, consisting of the article a and the noun while, which means “a short period of time".
The one-word awhile is an adverb（副詞）, which means “for a short period of time”.
Although the two have similar definitions and can sometimes be used interchangeably here are some rules to help you keep them straight.
The noun phrase a while can (and often does) follow a preposition（前置詞）, such as for or in.
- Ben said he would be here in a while. ( = He is not here now, but is coming)
- I talked to my friend for a while.
The adverb awhile cannot follow a preposition（前置詞）.
- You should rest awhile. ( = you should rest for a while)
- Ben said he would be here awhile ( = Ben is here and will stay for a while)
The base word while is most commonly a conjunction（接続詞）, meaning during, although, or throughout the time.
- I ate kakipi while watching Itte Q."
I hope that helps clear up any confusion you might have had.