As per the Mahabharata, Vidura was the half-brother to the kings Dhritarashtra and Pandu of Hastinapura, born the son of the sage Vyasa and Parishrami, the maid to the queens Ambika and Ambalika of the city. By some accounts, he was an incarnation of the god of death and justice Yama Dharma Raja, who had been cursed by the sage Mandavya for punishing the latter more harshly than his transgression warranted.

Both Ambika and Ambalika were wives of King Vichitravirya of Hastinapura, who died childless. Anxious to ensure the continuation of the royal lineage, Vichitravirya's mother Satyavati called another of her sons, the ascetic Vyasa, to bestow motherhood upon the two widowed queens. Vyasa, as a hermit practicing severe austerities, was unpleasant and even fearsome in appearance, so much so that Ambika shut her eyes tight when she saw him, and her sister Ambalika went pale with fear. Vyasa informed his mother that as a result, the sons they bore would respectively be blind (Dhritarashtra), and pale (Pandu).

Fearing that no such child would be a worthy heir, Satyavati asked Vyasa to grant another son to Ambika. Still fearful of Vyasa, Ambika sent the maid to Vyasa. This dutiful lady was not frightened by Vyasa's appearance and bore a normal, healthy, son. Thus, Vidura was born.

Vidura was raised and educated by Bhishma as the half-brother of Dhritarashtra and Pandu. However, since neither of his parents were of the royal blood, he was made counselor to his brothers, the kings, rather than a king himself. When Satyavati asked about her grandchildren's strengths, Bhishma praised Dhristarashtra's strength, Pandu's military prowess, and Vidura's intellect. When time came for a crown prince to be chosen, it was Vidura who brought up the elephant in the room-namely that despite being older, Dhritarashtra's blindness made him an unfit king. Vidura then supported Pandu's election to the kingship, much to the relief of Hastinapur's prime minister. Despite knowing that he was right, and even agreeing with the verdict, Dhritarashtra held a little bit of resentment towards Vidura for this incident.

Upon Pandu's abdication and the blind Dhritarashtra's succession, Vidura took on the reins of government for all practical purposes, guiding his brother's government until Duryodhana came of age, when he was consigned to a secondary role.

In some versions, it is believed that Vidura is elder to Dhritarashtra and Pandu, for when Bhishma asked Vidura for counsel on the marriages of the three princes, he indicated in order the brides for Vidura - a Yadava girl named Sulabha, Dhritharashtra - Gandhari and Pandu - Kunti, in the order of precedence accorded by age. According to this version, Ambika initially sent a maid in her place out of fear of Vyasa, and the sage perceiving an act designed by destiny for some greater purpose, blesses her with a son, making Vidura an incarnation of Dharma instead of the Mitra-Varuna pair. This event is considered to be a major transition from the Vedic to the Upanishad age. Contemporary translators, however have ignored this due to transcreations. Ambalika later was persuaded to present herself to Vyasa, but turned pale and gave birth to Pandu, as recounted above.

Barring Krishna, Vidura was most respected as an adviser by the Pandavas, whom he forewarned on various occasions of Duryodhana's plots to exterminate them, such as Duryodhana's plan to burn them alive in the house of wax.

Excepting the prince Vikarna, Vidura was the only one who protested against the humiliation of Draupadi in the Kaurava court. In that moment, Duryodhana viciously rebuked Vidura, calling him ungrateful. Dhritarashtra moved to rebuke Duryodhana for insulting Duryodhana's uncle, but, remembering Vidura saying that a blind man cannot be king, holds his tongue, and instead reprimanded Duryodhana for insulting the prime minister. It is that incident that Vidura brought up years later when he severed ties with the Kurus and sided with the Pandavas at the onset of the Kurukshetra war. Unlike Bhisma, Dronacharya, Kripacharya, Karna, etc., Vidura did not have an obligation to Hastinapur or Duryodhana, but to his family. Hearing Dhritarashtra not acknowledge that relationship, Vidura felt compelled to side with dharma and the Pandavas.

According to Krishna, Vidura was considered as Dharmaraja, which means the lord of truth. Krishna respected Vidura for his devotion to people's welfare, and his proficiency in every sphere of knowledge.

When Krishna visited Hastinapura as a peace emissary of the Pandavas, he shunned Duryodhana's offer to stay in the royal palace, preferring instead the home of Vidura, on account of him being the only neutral man in the Kaurava court. The reason Krishna stayed in Vidura's chambers for the night instead of Duryodhana's is due to the thoughts which were running through their heads and the difference between them. When Krishna had come to Hastinapura, Duryodhana had presented him with a gracious welcoming committee, with the palace decorated extravagantly for his arrival. A huge feast was also set up so that Krishna may eat to his heart's content. Upon arrival, however, and to Duryodhana's disappointment, Krishna bluntly refused to eat or stay in his chambers for the night.

The reason he refused so instantaneously is because the thought which harbored inside Duryodhana's mind. His intention was to give all the pleasures of food and welcome Krishna like a king and slowly convince him to join the side of the Kauravas. He had a plan to destroy the Pandavas and their growing army, and the best way to do this was to bring Krishna onto their side. Sensing this intention, Krishna refused. Krishna knew the food that Vidura presented was presented with love and affection. Vidura truly wanted Krishna to reside in his house for the night before leaving because he truly loved his friend. Krishna also mentioned that there would be two reasons that he would stay in someone's house, if the food was presented with love and also if he was hungry. He was neither hungry nor was the food presented to him with the best intentions of love, so Krishna declined Duryodhana's invite and stayed at Vidura's house.

After the great battle, Yudhishthira appointed Vidura the prime minister with complete control of the government. However, following the carnage of the war and his own age, Vidura did not have the heart to govern. Soon after, he retired to the forests as an ascetic with his half-brother Dhritarashtra and his sisters-in-law Gandhari and Kunti. He undertook severe penances and was the first of the royal ascetics to die.