Shloka (meaning "song", from the root śru, "hear") is a category of verse line developed from the Vedic Anustubh poetic meter. It is the basis for Indian epic verse, and may be considered the Indian verse form par excellence, occurring, as it does, far more frequently than any other meter in classical Sanskrit poetry. The Mahabharata and Ramayana, for example, are written almost exclusively in shlokas. The traditional view is that this form of verse was involuntarily composed by Valmiki in grief, the author of the Ramayana, on seeing a hunter shoot down one of two birds in love.
The shloka is treated as a couplet. Each hemistich (half-verse) of 16 syllables, composed of two Pādas of eight syllables, can take either a pathyā ("normal") form or one of several vipulā ("extended") forms. The form of the second foot of the first Pāda (II) limits the possible patterns the first foot (I) may assume, as in the scheme below. Alternatively, a shloka is four quarter-verses, each with eight syllables.
The Pathyā and Vipulā half-verses are arranged in the table above in order of frequency of occurrence. Out of 2579 half-verses taken from Kalidasa, Magha, Bharavi, and Bilhana, each of the four admissible forms of shloka in the above order claims the following share: 2289, 116, 89, 85.
The metrical constraints on a hemistich in terms of its two constituent padas are as follows:
- The 1st and 8th syllables of both pādas are anceps.
- The 2nd and 3rd syllables cannot both be light (laghu, "⏑") in either pāda; i.e. one or both of the 2nd and 3rd syllables must be heavy (guru, "–") in both pādas.
- Syllables 2-4 of the second pāda cannot be a ra-gaṇa (the pattern "– ⏑ –")
- Syllables 5-7 of the second pāda must be a ja-gaṇa ("⏑ – ⏑") This enforces an iambic cadence.
- Syllables 5-7 of the first pāda must be a ya-gaṇa ("⏑ – –")
- na-vipulā: Syllables 5-7 are a na-gaṇa ("⏑ ⏑ ⏑")
- bha-vipulā: Syllables 2-7 are ra-bha gaṇas ("– ⏑ – – ⏑ ⏑") or ma-bha gaṇas with a caesura in between ("– – – , – ⏑ ⏑")
- ma-vipulā: Syllables 2-7 are ra-ma gaṇas with a caesura after the 5th ("– ⏑ – – , – –")
- ra-vipulā: Syllables 5-7 are a ra-gaṇa following a caesura (", – ⏑ –")
Noteworthy is the avoidance of an iambic cadence in the first pāda. By comparison, Syllables 5-7 of any pāda in the old Vedic anuṣṭubh is typically a ja-gaṇa ("⏑ – ⏑"), or a dijambus.
An example of an anuṣṭubh stanza which fails the classical requirements of a shloka is from the Shatapatha Brahmanaāsandīvati dhānyādaṃ rukmiṇaṃ haritasrajam abadhnādaśvaṃ sārańgaṃ devebhyo janamejayaḥ "In Āsandîvat, Janamejaya bound for the gods a black-spotted, grain-eating horse, adorned with a golden ornament and with yellow garlands."
A shloka, states Monier-Williams, can be "any verse or stanza; a proverb, saying..".
The shloka and Anushtubh meter has been the most popular verse style in classical and post-classical Sanskrit works. It is octosyllabic, next harmonic to Gayatri meter that is sacred to the Hindus. A shloka has a rhythm, offers flexibility and creative space, but has embedded rules of composition. The Anushtubh is present in Vedic texts, but its presence is minor, and Trishtubh and Gayatri meters dominate in the Rigveda for example. A dominating presence of shlokas in a text is a marker that the text is likely post-Vedic.
The shloka structure is embedded in the Bhagavad Gita, the Mahabharata, the Ramayana, the Puranas, Smritis and scientific treatises of Hinduism such as Sushruta Samhita and Charaka Samhita. The Mahabharata, for example, features many verse meters in its chapters, but an overwhelming proportion of the stanzas, 95% are shlokas of the anustubh type, and most of the rest are tristubhs.