Dharanis (IAST: dhāraṇī), also known as (Skt.) vidyās and paritas or (Pal.) parittas, are lengthier Buddhist mantras that function as mnemonic codes, incantations, or recitations. Almost all were composed in Sanskrit, although there are some Pali dharanis. Believed to generate protection and the power to generate merit for the Buddhist practitioner, they constitute a major part of historic Buddhist literature. Most dharanis are in Sanskrit written in scripts such as Siddhaṃ as can be transliterated into Chinese, Korean, Japanese, Vietnamese, Sinhala, Thai and other regional scripts. They are similar to and reflect a continuity of the Vedic chants and mantras.
Dharanis are found in the ancient texts of all major traditions of Buddhism. They are a major part of the Pali canon preserved by the Theravada tradition. Mahayana sutras such as the Lotus Sutra and the Heart Sutra include or conclude with dharani. Some Buddhist texts, such as Pancarakṣa found in the homes of many Buddhist tantra tradition followers, are entirely dedicated to dharani. They are a part of the regular ritual prayers as well as considered to be an amulet and charm in themselves, whose recitation believed to allay bad luck, diseases or other calamity. They were an essential part of the monastic training in Buddhism's history in East Asia. In some Buddhist regions, they served as texts upon which the Buddhist witness would swear to tell the truth.