Thanks for text courtesy from WIKIPEDIA. visit and read more:
In the context of the Vedas, the term mantra refers to the entire portion which contains the texts called Rig, Yajur or Saam, that is, the metrical part as opposed to the prose Brahmana commentary. With the transition from ritualistic Vedic traditions to mystical and egalitarian Hindu schools of Yoga, Vedanta, Tantra and Bhakti, the orthodox attitude of the elite nature of mantra knowledge gave way to spiritual interpretations of mantras as a translation of the human will or desire into a form of action, with some features in common with spells in general.
For the authors of the Hindu scriptures of the Upanishads, the syllable Aum, itself constituting a mantra, represents Brahman, the godhead, as well as the whole of creation. Kūkai suggests that all sounds are the voice of the Dharmakaya Buddha — i.e. as in Hindu Upanishadic and Yogic thought, these sounds are manifestations of ultimate reality, in the sense of sound symbolism postulating that the vocal sounds of the mantra have inherent meaning independent of the understanding of the person uttering them.
Nevertheless, such understanding of what a mantra may symbolize or how it may function differs throughout the various traditions and also depends on the context in which it is written or sounded. In some instances there are multiple layers of symbolism associated with each sound, many of which are specific to particular schools of thought. For an example of such see the syllable: Aum which is central to both Hindu and Buddhist traditions.
While Hindu tantra eventually came to see the letters as well as the sounds as representatives of the divine, the shift toward writing occurred when Buddhism traveled to China. Although China lacked a unifying, ecclesiastic language like Sanskrit, China achieved its cultural unity through a written language with characters that were flexible in pronunciation but more precise in meaning. The Chinese prized written language much more highly than did the Indian Buddhist missionaries, and the writing of mantras became a spiritual practice in its own right. So that whereas Brahmins had been very strict on correct pronunciation, the Chinese, and indeed other Far-Eastern Buddhists were less concerned with this than correctly writing something down. The practice of writing mantras, and copying texts as a spiritual practice, became very refined in Japan, and the writing in the Siddham script in which the Sanskrit of many Buddhist Sutras were written is only really seen in Japan nowadays. However, written mantra-repetition in Hindu practices, with Sanskrit in any number of scripts, is well-known to many sects in India as well.