
Chandas Shastra -- Pingala's Science of Meter, and How It Gave India the Binary Number
छन्दःशास्त्र -- पिंगल का मात्रा विज्ञान, और भारत को मिला द्विआधारी अंक
Open any Sanskrit shloka. Pick the Bhagavad Gita, the Ramcharitmanas, a Rig Vedic hymn, a Bollywood bhajan lyric. Read it aloud. Your voice will settle into a pattern of stresses and pauses almost before your ear knows it. Sanskrit, unlike English, does not let a line stagger about. The line either scans or it does not. What lets you hear this without ever having been taught is a science called Chandas, the sixth of the six Vedangas, and the person who gave that science its textbook form is Acharya Pingala.
Chandas means, at the most ordinary level, metre. More deeply, the root chad carries the sense of pleasing, alluring, covering. A chhandas is a pattern that pleases the ear, covers the meaning in rhythm, and carries the verse across centuries without the verse breaking on the way. Long before Pingala arrived, the Vedic rishis were already composing hymns in fixed metres: Gayatri, Ushnik, Anushtubh, Brihati, Pankti, Trishtubh, Jagati. The Rig Veda knows these names. The Brahmanas discuss them. What did not exist before Pingala, as far as surviving evidence shows, was a single compact manual that laid out every metre the tradition used and explained the mathematics underneath them.
That manual is the Chandah-Shastra, also called the Pingala-Sutras. It runs across eight chapters, roughly 310 terse sutras in the classic late-sutra style, and has been carefully preserved by the commentarial chain for about twenty-three centuries. The work is dated to the last few centuries BCE, with most modern scholars placing Pingala himself around the 3rd or 2nd century BCE. That dates him close to Panini, whose grammar sits in the same family of sutra compositions; tradition even claims Pingala was Panini's younger brother, though the evidence for that specific relationship is indirect.
गायत्रेण प्रति मिमीते अर्कमर्केण साम त्रैष्टुभेन वाकम्। वाकेन वाकं द्विपदा चतुष्पदाक्षरेण मिमते सप्त वाणीः॥
gāyatreṇa prati mimīte arkam arkeṇa sāma traiṣṭubhena vākam | vākena vākaṃ dvipadā catuṣpadā akṣareṇa mimate sapta vāṇīḥ ||
With the Gayatri (meter) he measures a song; with the song, a chant; with the Trishtubh, a recited stanza. With stanzas of two and four feet, a hymn is measured. With the syllable itself, they measure the seven voices.
— Rig Veda 1.164.24 (Asya Vamasya Sukta, Rishi Dirghatamas)
Before any of Pingala's metres can come alive, two building blocks have to be fixed. The first is the syllable itself, the akshara. In Sanskrit, a syllable is either laghu (light, short, one matra) or guru (heavy, long, two matras). A matra is the basic time unit, roughly the duration of the short vowel a as a student pronounces it. A short a is laghu. A long a (aa), a diphthong, or any vowel followed by a conjunct consonant becomes guru. The second building block is the pada, the line or foot of a verse. A pada has a fixed syllable count, and a chhandas is defined by the pattern of padas that make up its full stanza.
With those two pieces in hand, the traditional seven-fold classification of Vedic metres falls out almost naturally. The Rig Veda itself hints at the list. The Gayatri has three padas of eight syllables each, for a total of twenty-four. The Ushnik has twenty-eight. The Anushtubh has thirty-two, and it is the Anushtubh that became the standard shloka of later Sanskrit poetry; the Bhagavad Gita, the Ramayana, the Mahabharata, and most of Puranic literature sit in it. The Brihati has thirty-six, the Pankti forty, the Trishtubh forty-four, and the Jagati forty-eight. Each step up the ladder adds one more unit of four syllables, until you arrive at the Jagati. This is not a random scheme. It is the Vedic way of saying that the shorter metres are used for intimate invocations and the longer ones for cosmic themes, with the Anushtubh at the centre as the everyday conversational metre of the tradition.
Modern scholars add that the Gayatri alone accounts for about a quarter of the Rig Veda, and the Trishtubh for another large fraction. When a Kashi Brahmin chants the Purusha Sukta at Manikarnika Ghat at dawn, he is speaking largely in Anushtubh and Trishtubh. When a Kota NEET aspirant chants the Gayatri mantra before her morning study session, she is using twenty-four syllables of Gayatri metre. The structure is the same now as it was three millennia ago.
The Seven Vedic Chhandas -- Pingala's Core Classification
| Meter | छन्द | Syllables per Stanza | Structure (padas x syllables) | Famous Use |
|---|---|---|---|---|
| Gayatri | गायत्री | 24 | 3 x 8 | Gayatri Mantra, Rig Veda 3.62.10 |
| Ushnik | उष्णिक् | 28 | 3 x (8+8+12) or 4 x 7 | Mid-frequency Vedic hymns, Savita invocations |
| Anushtubh | अनुष्टुप् | 32 | 4 x 8 | Bhagavad Gita, Manu Smriti, classical shloka |
| Brihati | बृहती | 36 | 4 x (8+8+12+8) | Brihaspati hymns, many Soma mandalas |
| Pankti | पंक्ति | 40 | 5 x 8 or 4 x 10 | Several Rig Veda and Atharva hymns |
| Trishtubh | त्रिष्टुप् | 44 | 4 x 11 | Purusha Sukta core, second most common Rig Vedic metre |
| Jagati | जगती | 48 | 4 x 12 | Cosmological and royal hymns, Mandukya Upanishad sections |
Each metre's stanza adds four syllables to the one below it. The Anushtubh at thirty-two became the shloka metre of classical Sanskrit; that is the metre a JNU student memorising a Gita shloka for her oral exam is actually memorising.
Pingala's first chapter lays the foundations: definitions of laghu and guru, the pada, the stanza, and the names of the meters. From the second chapter onward, he moves through Vedic metres in turn. By the later chapters he has moved on to classical metres -- the fixed-syllable varna-vritta patterns that produce forms like Anushtubh, Indravajra, Upendravajra, Vasantatilaka, Malini, Mandakranta, Shardulavikridita, and Shragdhara. Kedara Bhatta's Vritta-Ratnakara, composed around the eighth century CE and still the standard manual in Sanskrit colleges, builds directly on this second half of Pingala.
One of Pingala's most practical tools is the gana system. Any metrical line can be broken into groups of three syllables, and each three-syllable group falls into exactly eight possible light-heavy patterns. Pingala named these eight ganas with single-syllable labels: ma, ya, ra, sa, ta, ja, bha, na. A ma-gana is three heavies in a row; a na-gana is three lights; the other six mix the two. Medieval commentators, most famously Halayudha, built a mnemonic out of these labels. The string yamātārājabhānasalagāṃ is constructed so that any three consecutive syllables in the string name a particular gana and also illustrate its pattern, because the short a (laghu) and long ā (guru) are chosen to match. The string works like a rotating three-syllable window: read from ya, you get ya-gana; read from ma, you get ma-gana; and so on. A single nonsense word that teaches all eight patterns by example.
This is not a museum piece. Every Sanskrit poet who composed a new metre from Kalidasa down to Jagannatha Panditaraja used these ganas as building blocks. When a Bhojpuri folksinger constructs a dohā, she is unconsciously honouring the same counting. When a Bollywood lyricist writes a mukhda that scans smoothly in classical filmi style, the Anushtubh genealogy runs under his pen. The Pingala gana-scheme is the quiet grid on which a great deal of Indian verse, across languages, still sits.
तस्माद्यज्ञात्सर्वहुत ऋचः सामानि जज्ञिरे। छन्दांसि जज्ञिरे तस्माद्यजुस्तस्मादजायत॥
tasmād yajñāt sarva-hutaḥ ṛcaḥ sāmāni jajñire | chandāṃsi jajñire tasmāt yajus tasmād ajāyata ||
From that all-embracing sacrifice, the Rig verses and Sama chants were born. The meters were born from it. The Yajus was born from it.
— Rig Veda 10.90.9 (Purusha Sukta)
The verse is worth pausing on. The Purusha Sukta is the cosmic-sacrifice hymn that late Vedic thought turned into the philosophical core of the Samhita. When it lists what came out of that first sacrifice, chhandas stands alongside the Rig, Sama, and Yajus. Metre is not decoration sitting on top of the Veda. Metre is one of the things the Veda itself is made of.
And here is where Pingala's work stops being a simple classification manual and turns into a landmark in the history of human thought. In the eighth and final chapter of the Chandah-Shastra, Pingala introduces six procedures, called pratyayas, that operate on metres the way algorithms operate on data. Prastara enumerates every possible laghu-guru pattern for a line of n syllables. Nashta takes a serial number and tells you which pattern it corresponds to. Uddishta does the reverse -- given a pattern, tells you its serial number. Laghu-kriya counts how many patterns have a given number of guru syllables. Sankhya tells you the total number of possible patterns. Adhva measures the physical space each pattern would occupy if written out.
The heart of the prastara procedure, spread across sutras 8.20 through 8.23 with Halayudha's commentary opening them up, is a recursive rule. To get every possible pattern for a line of n syllables, take every pattern of n-1 syllables, and in front of each one put once a guru and once a laghu. For n = 1 there are two patterns: laghu and guru. For n = 2 there are four, for n = 3 there are eight. In general there are 2 to the power n. This is the same arithmetic that drives every modern digital circuit. Each syllable slot is a bit. Each line is a binary string. Pingala's enumeration scheme is the world's oldest recorded description of a binary numeral system in use.
The deeper mathematical consequences of Pingala's scheme were mostly unpacked by his tenth-century commentator Halayudha, whose Mrita-Sanjivini remains the single most consulted gloss on the Chandah-Shastra. Halayudha was writing from Karnataka in the tenth century, about twelve hundred years after Pingala, and he did two things that earned him an independent place in the history of Indian mathematics.
First, Halayudha drew out of Pingala's sutras what is now called the Meru Prastara -- the triangular array showing, for each line length n, how many patterns contain exactly zero guru syllables, how many contain one, two, three, and so on. When you stack these counts for increasing n, you get the triangle that modern Europe learned to call Pascal's triangle, named after Blaise Pascal in the seventeenth century. Halayudha did not invent the triangle; he recognised it inside Pingala's sutras and displayed it visually. Pingala implied it. Halayudha illustrated it. The Meru is the mathematical object that both did.
Second, and even more striking, Pingala's work on mātrā-vrittas, the metres counted by total matra rather than by syllable, generates a sequence in which each term is the sum of the previous two. That sequence is what we now call the Fibonacci sequence. Virahanka, a Jain prosodist writing sometime between the sixth and eighth centuries CE, stated this addition rule explicitly, several centuries before Leonardo of Pisa used the same numbers in his Liber Abaci in 1202 CE. In Indian tradition the sequence is called the mātrā-meru. The Indian origin of the sequence was slowly documented through the twentieth century, most thoroughly by Parmanand Singh's 1985 paper in Historia Mathematica, and is now uncontested in the history of mathematics community.
Halayudha is the reason a reader today can walk into the Chandah-Shastra without losing their footing. Without his commentary, most sutras are either unreadable or could only be read by someone who already knew the content. Every modern edition, from Weber's 1863 German edition to Sarup's work in the 1920s to the Chowkhamba Sanskrit Series releases in Varanasi, keeps Halayudha beside Pingala on every page.
It takes some care to say what Pingala did and did not do, because the territory is contested. Pingala did not use the symbol zero as an arithmetic operator. Halayudha used it more freely about twelve centuries later. What Pingala did was use two contrasting syllable weights as a positional encoding, traverse every possible combination in a defined order, and use recursive rules to move between a serial index and the pattern at that index. That operation is what the modern field of computer science calls binary enumeration. To call Pingala the first figure in any written record to perform this operation is a claim the history-of-mathematics literature generally accepts.
Gottfried Wilhelm Leibniz, writing in 1679 and publishing more fully in 1703, is the European figure usually credited with introducing binary arithmetic to modern Western thought. Leibniz worked independently; he did not know Pingala. But a thoughtful reading of the Chandah-Shastra shows that the operational ideas of binary encoding and decoding were already worked out, inside a different problem domain, nearly two thousand years earlier. The history is plural; discovery can happen twice.
Out of this the Indian contribution to Chandas has moved quietly into the places one would expect. At IIT Bombay, the Computation for Indian Language Technology group uses Pingala-style metrical tagging in its Sanskrit corpus processing. At IIIT Hyderabad, Sanskrit prosody tools for automatic meter identification start by encoding each syllable as a bit. At IIT Kharagpur, the Sanskrit Computational Linguistics team tests poems against the Pingala pratyaya rules to verify metrical correctness. A recent DST-funded project at Jain University, Bengaluru, aimed to build a complete digital Chandah-Shastra learning platform -- sutras, Halayudha gloss, and interactive prastara tables, all on a mobile-first app. Pingala is, in quiet ways, still employed in 2026.
Working through the prastara at a small size makes all of this concrete. Take a line of three syllables. Pingala's rule says: start with one laghu and one guru for a single syllable. For two syllables, prepend each of those to itself twice, once with guru and once with laghu in front. For three syllables, repeat once more. The eight patterns that come out, in Pingala's order, are GGG, LGG, GLG, LLG, GGL, LGL, GLL, and LLL. Replace guru with 0 and laghu with 1, read each pattern from right to left, and you get the numbers 0, 1, 2, 3, 4, 5, 6, 7 in standard binary. The order is neither decorative nor accidental. It is the same order any modern binary counter runs through, minus the later convention of starting from zero instead of one.
The matra-meru runs on a similar recursion, but counts by total matra rather than by syllable. How many valid patterns are there whose total matra count is exactly six? A laghu contributes one matra and a guru contributes two, so the question is how many ways can you write six as an ordered sum of ones and twos. The answer is given by a recursion: the count for n matras equals the count for n minus one (start with a laghu) plus the count for n minus two (start with a guru). For n equal to one through eight the counts are 1, 2, 3, 5, 8, 13, 21, 34. That sequence is famous in modern mathematics as the Fibonacci numbers. The Indian tradition's name for it, matra-meru, is literally mountain of matras. Virahanka wrote the addition rule down in the seventh or eighth century CE. Leonardo of Pisa wrote the same sequence down in 1202 CE. Both worked honestly; the Indian record is older. This is the kind of finding that sits comfortably in a well-sourced lecture at the Indian Statistical Institute, Kolkata, or the mathematics seminar at TIFR Bengaluru, without requiring anyone to overstate the case.
When a child in a Dehradun school memorises the standard Hindi nursery rhyme Machhli Jal Ki Rani Hai, she is already using a matra-vritta. The rhyme scans as sixteen matras per line, a classic Chaupai pattern, which is the metre Tulsidas chose for the Ramcharitmanas. The reason the Manas was memorisable by a largely non-literate village population in seventeenth-century Awadh is that the Chaupai metre is a direct descendant of Pingala's matra counting. What works for a kindergarten rhyme in 2026 is what worked for a fifteen-thousand-verse devotional epic in 1574.
The practical reach of Chandas in Indian life is much wider than most Indians realise. The Ramcharitmanas runs in Chaupai and Doha. The Hanuman Chalaka is forty Chaupai stanzas framed by two Dohas. A Kabir doha is thirteen plus eleven matra, an asymmetry that gives it its crack-of-whip quality. Mirabai's bhajans sit in mixed metre but obey matra counts. A Punjabi Gurbani shabad scans cleanly in classical padas. A Carnatic kriti is metrically governed at a level below the melody; Tyagaraja and Muttuswami Dikshitar composed in a prosodic system that traces straight back to Sanskrit matra-vritta.
The Bollywood industry leans on all of this whether its writers name the tradition or not. When Gulzar writes a ghazal, he is inside a metre he could cite in Sanskrit terms if asked. When Javed Akhtar structures a mukhda, his ear is trained on patterns that Pingala would recognise within seconds. When a Bangalore-based indie singer releases a Hindi pop song with a deliberate four-beat anushtubh feel, she is recording a direct descendant of the Rig Veda's central metre. There is no other living metrical tradition in the world that has stayed this continuous for this long.
For the student, the lesson of Chandas is not that you must memorise a hundred metres before you can read a shloka. The lesson is that Sanskrit verse is engineered. Every chhandas carries a body-memory. The Gayatri metre is meant to bring you to a seated, still posture at dawn; its three lines of eight syllables each give the breath a three-count cycle. The Anushtubh is meant to be spoken while walking or teaching; its four-times-eight structure tracks the stride. The Trishtubh is meant for a seated hymn, longer breath, more ornament. A well-written Sanskrit shloka is not only a message. It is a container precisely shaped to fit how a body holds that message. Pingala wrote the manual for the container. The Rig Veda filled it with the hymns. Between the two, an entire civilisation learned how to remember.
Meter-Tag Any Shloka in the Scripture Reader
Open the Eternal Raga Scripture Reader and tap any Bhagavad Gita or Rig Veda verse. A Chandas overlay appears, marking each syllable as laghu or guru, naming the metre, and showing which of Pingala's gana patterns the line belongs to. A built-in prastara explorer lets you generate every possible pattern for a line of four to twelve syllables.
Tags
Eternal Raga · शाश्वत राग
Institutional voice — scholarly articles on Sanatan Dharma
Deepen Your Understanding
अपनी समझ और गहरी करें
vedic sciences
Shad Vedangas -- The Six Limbs of the Veda
The Vedas are not a single book you can pick up and read. They are a living system with six auxiliary sciences -- phonetics, metre, grammar, etymology, astronomy, and ritual procedure -- that function like limbs of a body. Without them, the Vedas are a voice without a mouth, a path without eyes. Here is the operating manual India's knowledge system ran on for three thousand years.
vedic sciences
Nirukta -- How Yaska Built the World's First Etymology Textbook
Before Panini's grammar, before Merriam-Webster, before Google defined anything, Yaska wrote the Nirukta -- a sixth century BCE manual that asked a daring question: what does a word actually mean, and how do we prove it?
vedic sciences
Vedanga Jyotisha -- The Oldest Indian Calendar Science and the Eye of the Veda
Before Aryabhata, before the Surya Siddhanta, before the elaborate planetary models of classical Indian astronomy, there was a small text of 36 verses (Rig Veda recension) or 44 verses (Yajur Veda recension) that laid the foundation for everything. The Vedanga Jyotisha, attributed to the sage Lagadha and dated to roughly 1400-1200 BCE, is the oldest surviving Indian text on astronomy and calendrical science. It is not a stargazer's manual. It is a ritual engineer's handbook -- designed to answer one critical question: when exactly should the Vedic sacrifices be performed? From that question emerged the entire Indian tradition of tracking the sun, moon, and stars.
vedic sciences
Shiksha -- The Vedanga of Sound, and Why One Mispronounced Syllable Can Flip a Mantra's Meaning
The Vedic tradition is obsessed with how a syllable leaves the mouth -- which organ shaped it, at what pitch, for how long. The Vedanga that codifies this obsession is Shiksha. Its textbooks fix the exact acoustic architecture that has kept the Veda unchanged for three thousand years.
vedic sciences
Kalpa Sutras -- The Vedanga That Runs the Yajna, the Samskara, the Dharma, and the Altar Geometry
If Shiksha governed sound and Chandas governed meter, Kalpa governed doing -- the actual procedure of Vedic ritual from a child's naming to a king's coronation. Tucked inside its geometry manuals sits the earliest recorded statement of the theorem the Greeks later called Pythagorean.
vedic sciences
Surya Siddhanta -- The Ancient Astronomy Text That Got the Year Right to 1.4 Seconds
Before Copernicus, before Galileo, before the telescope existed -- an Indian text calculated the tropical year as 365.2421756 days. The modern value is 365.2421904. The difference is 1.4 seconds per year. The Surya Siddhanta also described gravity, computed planetary diameters within 1% accuracy, and invented the sine function. It did all this in Sanskrit verse.
vedic sciences
Kaal Ganana -- The Hindu Measure of Time
From a single blink of the eye (Nimesha) to one Day of Brahma (4.32 billion years) -- explore the complete cosmic time hierarchy of Hindu cosmology, anchored in Vishnu Purana 1.3, with its remarkable parallels to modern science.
When a child in a Dehradun school memorises the standard Hindi nursery rhyme Machhli Jal Ki Rani Hai, she is already using a matra-vritta. The rhyme scans as sixteen matras per line, a classic Chaupai pattern, which is t…
More in Vedic Sciences

Agnichayana -- The Falcon-Shaped Fire Altar That Survived 3,000 Years
12 min read
Ancient Indian Metallurgy -- The Iron Pillar That Refuses to Rust
13 min read
Charaka vs Sushruta -- The Two Founders of Ayurveda and Why India Had Both Internal Medicine and Surgery 2,000 Years Ago
12 min readThe same translation error that turned '33 Koti' into '33 crore' in Hinduism also happened in Buddhism. The Chinese translation of Buddhist texts rendered 'Sapta Koti Buddha' (7 Supreme Buddhas) as '7 Crore Buddhas.' The…
Deities AvatarsCommunity Reflections
🕉️
Be the first to share your reflection.