Lord Ganesha has also taken eight incarnations from time to time to protect Dharma. These eight incarnations are called Ashtavinayak. This Ashtavinayak has different significance and stories. This Ashtavinayak have born in different Yugas for protecting Dharma.
First Avatar is Vakratunda
Lord Ganesha took the Vakratunda avatar to kill a demon named Matsarasura. Matsarasura was a devotee of Lord Shiva and he had obtained a boon from Lord Shiva that he would not be afraid of any creature. Matsarasura also had two sons and both were oppressors. After getting the boon, Matsarasura started torturing the deities by the order of Shukracharya. Then Lord Ganesha defeated Matsarasura by taking Vakratunda avatar and killed both his sons.
Second Avatar is Ekdanta
Once Maharishi Chyawan had created Mada through his Tapobal and he was also called the son of Maharishi. After taking initiation from the demon guru Shukracharya, Mada started torturing the deities. Then all the deities invoked the son of Lord Shiva and Mother Parvati, then the Lord incarnated as Ekadanta. Ekdant Ashtavinayak defeated Madasura in the war and gave the boon of fearlessness to the gods.
Third Avatar is Mahodar
Demon Guru Shukracharya prepared a demon named Mohasur to fight against the gods by giving him education and initiation of weapons. Distressed by the atrocities of Mohasur, the gods and goddesses together invoked Lord Ganesha. Then Ganesha took the incarnation of Mahodar.
Fourth Avatar is Vikat
Once Lord Vishnu broke the chastity of his wife Vrinda for the destruction of Jalandhar. After that Jalandhar had a son Kamasura. Kamasur had done severe penance to Lord Shiva, pleased with which Mahadev had given him the boon of Trilok Vijay. After getting the boon, Kamasur started torturing the gods. Distressed by the demon, all the deities meditated upon Lord Ganesha and prayed for salvation from the demon. Then Lord Ganesha took a formidable avatar called Vikat. In this incarnation Lord Ganesha came sitting on a peacock and defeated Kamasur.
Fifth Avatar is Gajanan
Lobhasur was born out of the greed of Lord Kuber. Lobhasur went to the shelter of the demon Guru Shukracharya and took education from there. At the behest of Shukracharya, Lobhasura did hard meditation to get a boon from Lord Shiva. Pleased with the meditation, he gave the boon of being fearless to Lobhasur. After getting the boon, Lobhasur captured all the worlds. Everyone then prayed to Ganesha and Lord Ganesha incarnated as Gajanan. After this, on the advice of Shukracharya, Lobhasur accepted defeat without fighting.
Sixth Avatar is Lambodar
Once a demon named Krodhasur did penance to Suryadev. Pleased with the penance, Suryadev gave the incarnation of Krodhasur to conquer the universe. After this all the gods and goddesses got scared of Krodhasur and invoked Lord Ganesha. Hearing the prayer of the deities, Lord Ganesha took the incarnation of Lambodar. Lord Lambodar stopped Krodhasur and explained that he can never conquer the universe nor can he be an invincible warrior. Krodhasur then stopped his campaign and went to Patal Lok forever.
Seventh Avatar is Vighnaraj
Once Mata Parvati was walking on Mount Kailash with her friends, then there was laughter in the conversation. From his laughter a huge man was born and they named him ‘Mum’. Mum went to do penance in the forest, where she met Shambasura. Shambasura gave many demonic powers to Mum. After this, Mum pleased Ganesha and asked for the secret of the universe. When Shukracharya came to know about this, he gave the post of Daityaraj to Mum. After getting the post, Mum caught the gods and put them in jail. Then the deities invoked Lord Ganesha and informed him about their problems. Lord Ganesha incarnated as the Vighnaraj avatar and then by honoring Mamasur, freed the deities from the prison house.
Eighth Avatar is Dhumavarna
Once Brahmaji made the Sun God the master of the kingdom of Karma, this instilled pride in him. The Sun God sneezed while ruling, due to which a demon was born. The name of the demon born out of the sneeze was Aham. Aham Daitya went to Guru Shukracharya and became Ahantasur. After this, he also made his own kingdom and got a boon by worshiping Lord Ganesha. After getting the boon, Ahantasur started torturing the deities, then everyone invoked Lord Ganesha. On the call of the gods, Lord Ganesha took the incarnation of Dhurmavarna. The color of Dhurmavarna was like smoke and they were very formidable. He had a fierce noose in one hand, from which fierce flames were coming out. Dhurmavarna killed Ahantasura and gave relief to the deities.