QUICK ANSWER
"For a while" is a phrase which is often translated as "un rato", and "in a while" is an adverb which is often translated as "en un rato". Learn more about the difference between "for a while" and "in a while" below.
for a while(
fuhr
uh
wayl
)A phrase is a group of words commonly used together (e.g., once upon a time).
1. (general)
a. un rato
If you want Subway, the line is pretty long. You'll have to wait for a while.Si quieres comer Subway, hay una fila larga. Tendrás que esperar un rato.
b. por un tiempo
I think it would be good for us to take a break for a while.Creo que sería bueno que tomáramos un descanso por un tiempo.
c. hasta dentro de un rato (in negative phrases)
The doctor left an hour ago, and won't be back for a while.La doctora se fue hace una hora, y no regresará hasta dentro de un rato.
in a while(
ihn
uh
wayl
)An adverb is a word that describes a verb, an adjective, or other adverbs (e.g., to run quickly, very tired).
a. en un rato
I have to go to my next class. I'll see you in a while.Tengo que ir a mi próxima clase. Te veo en un rato.
b. enseguida
Will you mow the lawn? - Yeah, I'll do it in a while. I need to clean my room first.¿Puedes cortar el césped? - Sí, lo hago enseguida. Tengo que limpiar mi habitación primero.
a. hace rato
Where's Arianna? - I don't know. I haven't seen her in a while.¿Dónde está Arianna? - No sé. Hace rato que no la veo.
b. hace tiempo
I haven't talked to my parents in a while, but I'm going to visit them next week.Hace tiempo que no hablo con mis padres, pero voy a visitarlos la semana que viene.