Udayin (460-444 BCE) also known as Udayabhadra was a king of Magadha in ancient India. According to the Buddhist and Jain accounts, he was the son and successor of the Haryanka king Ajatashatru. Udayin laid the foundation of the city of Pataliputra at the confluence of two rivers, the Son and the Ganges. He shifted his capital from Rajagriha to Pataliputra due to the latter's central location in the empire.
According to the Buddhist accounts, the successors of the Magadha ruler Bimbisara were Ajatashatru, Udayabhadda (Udayin), Anuruddha, Munda and Nagadasaka. The Jain tradition mentions Udayin as the son and successor of Ajatashatru. Kings Bimbisara (558-491 BCE), Ajatashatru (492–460 BCE), and Udayin (460–440 BCE) of the Haryanka dynasty were patrons of Jainism. However, the Puranas name the successors of Bimbisara as Ajatashatru, Darshaka, Udayin, Nandivardhana and Mahanandin. The Matsya Purana names Vamsaka as the successor of Ajatashatru. Since the Buddhist texts were composed at a later date, the Hindu purans seems to be more reliable. The Nagadasaka of the Buddhist chronicles is identified with the "Darshaka" of the Puranas.
Professor H. C. Seth (1941) identified Udayin with the king Udayana mentioned in the Sanskrit play Svapnavasavadatta. The Chinese traveler Xuanzang states that the last descendant of Bimbisara built a sangharama (monastery) at Tiladaka. Seth theorized that this last descendant was Darshaka, and Udayin established a new dynasty, as signified by his transfer of the empire's capital from Rajgriha to Pataliputra. Liladhar B. Keny (1943) criticized Seth's theory as incorrect. According to him, the Udayana of Svapnavasavadatta was a different king, who ruled Vatsa kingdom with his capital at Kaushambi.
R. G. Bhandarkar notes that the name of Darshaka (Dasaka) is prefixed with the word "Naga" in the Buddhist chronicles, which may signify his detachment to his successors and his attachment to the Nagas of Padmavati . This implies that he may be from a different family and had become the king approximately three generations after Ajatashatru, not immediately succeeding him.