Gaijin (外人?) Literally meaning "outside person", is used to refer to all foreigners in Japan, whether resident or visiting. Some people consider it to be a pejorative term, best rendered as "outsider" or "alien". The more correct and polite term is Gaikokujin (外国人?) or "outside country person", while adding a -san or -sama immediately afterwards increases its level of politeness. In many ways this term has been appropriated by foreigners who often use it to describe themselves and their non-Japanese friends. Its usage is so widespread that it has been acknowledged as an English word since 1964. It is interesting to note that despite its meaning, a Japanese person will never consider themself to be a gaijin, even when in a foreign country.
Debito Arudou has proposed other terms as replacements, including takokujin (他国人?) (other-country person), nihon kokuseki de wa nai kata (日本国籍ではない方?) (non-Japanese national), nihonjin de wa nai kata (日本人ではない方?) (non-Japanese person), which he claims imply difference without the pejorative connotations of "gaijin" or "gaikokujin".