It is considered that Kojin was formed as a result of blending the ancient Japanese Aramitama, adopting a form of Yashashin originating from ancient India, and various elements such as Shinto, Esoteric Buddhism, mountain worship and so on.
日本古来の荒魂（あらみたま）に、古代インドに源泉をもつ夜叉神の形態が取り入れられ、神道、密教、山岳信仰などのさまざまな要素が混交して成立したものと思われる。