The Japanese Buddhist philosopher Kūkai drew a distinction between dharani (dhāra.nī) and mantra and used this as the basis of his theory of language. Mantra is restricted to esoteric Buddhist practice whereas dharani is found in both esoteric and exoteric ritual. Dharanis for instance are found in the Pali Canon see below. Kūkai coined the term "shingon" (lit "true word") as a Japanese translation of mantra.
The word dharani derives from a Sanskrit root dh.r which means to hold, or maintain. Ryuichi Abe suggests that it is generally understood as a mnemonic device which encapsulates the meaning of a section or chapter of a sutra. Dharanis are also considered to protect the one who chants them from malign influences and calamities.
The distinction between dharani and mantra is a difficult one to make. We can say that all mantras are dharanis but that not necessarily all dharanis are mantras. Mantras are generally shorter. Both tend to contain a number of unintelligible phonic fragments such as Om, or Hu.m which is perhaps why some people consider them to be essentially meaningless. Kūkai made mantra a special class of dharani and argued that every syllable of a dharani was a manifestation of the true nature of reality — in Buddhist terms that all sound is a manifestation of shunyata or emptiness of self-nature. Thus rather than being devoid of meaning, Kūkai suggests that dharanis are in fact saturated with meaning — every syllable is symbolic on multiple levels.