Mahabharata basics · Mahabharata questions
Which is older, the Mahabharata or the Ramayana?
Tradition places the Ramayana earlier, in the Treta Yuga, with the Mahabharata in the following Dvapara Yuga. Most scholars also date the core of the Ramayana slightly earlier, though both grew over centuries and the surviving Mahabharata contains material later than parts of the Ramayana.
In traditional chronology the answer is settled. The Ramayana belongs to the Treta Yuga and the Mahabharata to the Dvapara Yuga, which follows it, so Rama comes first by an entire world-age. The Mahabharata supports this internally: it retells the story of Rama as a tale told to console Yudhishthira in exile, the Ramopakhyana, which means the Rama story is already known within the world of the later epic. Hanuman, who belongs to the Ramayana, meets Bhima in the forest as a figure from an earlier age.
In scholarly terms the answer is close and messy. The usual position is that the core of Valmiki Ramayana, its books two through six, was composed somewhat earlier than the core of the Mahabharata, perhaps in the fifth to fourth centuries BCE, and that the Mahabharata core followed. But both texts were expanded for centuries afterwards, so late layers of the Ramayana, its first and last books among them, are later than early layers of the Mahabharata. Asking which epic is older is therefore a bit like asking which of two cities is older when both have been continuously rebuilt.
The two works differ in temper as much as in date. The Ramayana is shorter, more unified and more clearly the story of an ideal king. The Mahabharata is larger, encyclopaedic, and deliberately unresolved: its heroes win by breaking the rules they defend, and its recurring line is that dharma is subtle.
Both are called itihasa, which means roughly so it happened, a category the tradition keeps distinct from the Puranas and from myth.