In Hinduism, Shesha , also known as Sheshanaga (Śeṣanāga) or Adishesha (Ādi Śeṣa), is the nagaraja or king of all nāgas and one of the primal beings of creation. In the Puranas, Shesha is said to hold all the planets of the universe on his hoods and to constantly sing the glories of the God Vishnu from all his mouths. He is sometimes referred to as Ananta Shesha, which translates as endless-Shesha or Adishesha . It is said that when Adishesa uncoils, time moves forward and creation takes place; when he coils back, the universe ceases to exist.He is also described in Buddhism as Vasuki.
Vishnu is often depicted as resting on Shesha. He is considered a servant and a manifestation of Vishnu. He is said to have descended to Earth in two human forms or avatars: Lakshmana, brother of Rama; Balarama, brother of Krishna.
"Shesha" in Sanskrit texts, especially those relating to mathematical calculation, implies the "remainder" — that which remains when all else ceases to exist. But in Sanskrit it also means 6 shesham as the sheshanaga has been depicted to have many heads (5 to 7).
Shesha is generally depicted with a massive form that floats coiled in space, or on the ocean of bliss, to form the bed on which Vishnu lies. Sometimes he is shown as five-headed or seven-headed, but more commonly as a many thousand-headed serpent, sometimes with each head wearing an ornate crown.
His name means "that which remains", from the Sanskrit root śiṣ, because when the world is destroyed at the end of the kalpa, Shesha remains as he is.In the Bhagavadgita of Chapter 10, verse 29, Shri Krishna while describing 75 of his common manifestations, declares, "anantaś ca asmi nāgānāṁ": Of the nagas, I am Ananta.
As per the Mahabharata, he was born to sage Kashyap and his wife Kadru. Kadru gave birth to a thousand snakes, of which he was the eldest. After Shesha, Vasuki, Airavata and Takshaka were born, in order. A lot of Shesha's brothers were cruel and were bent upon inflicting harm on others. They were even unkind to Garuda, who was Kashyapa’s son through Vinatha, sister of Kadru. (Kadru and Vinatha were daughters of Daksha).
Shesha, disgusted by the cruel acts of his brothers, left his mother and kin, and took to austere penances. He lived on air and meditated in places including Gandhamadhana, Badrikashrama, Gokarna, Pushkara and Himalayas. His penances were so severe that his flesh, skin and muscles dried up and merged with his frame. Brahma, convinced of his will, asked him to request a boon.He asked that he be able to keep his mind under control so that he could continue to perform ascetic penances. Brahma gladly accepted the request. Brahma then asked a favour of Shesha: to go beneath the unstable earth and stabilize it. He agreed and went to the netherworld and stabilized her with his hood. He is known to support her even today, thus making Patala his perennial residence.