Tian Yu was born in the town of Yongnu in Yuyang commandery (present day Wuqing District, Tianjin). During Liu Bei's stay with Gongsun Zan, the young Tian Yu placed himself under Liu Bei's foster care, and Liu Bei was greatly impressed by Tian Yu. When Tian Yu left to care for his ageing mother, Liu Bei tearfully expressed his regret at not being able to work with Tian Yu.
Later Tian Yu served under Gongsun Zan as mayor of the town of Dongzhou. One of Gongsun Zan's generals, Wang Men, betrayed Gongsun Zan and joined Yuan Shao, and lead an attack on his former master with more than ten thousand troops. Tian Yu personally visited Wang Men and managed to shame the latter into retreating. Although Gongsun Zan knew of Tian Yu's intellect, he could not appoint important roles for Tian Yu. After Gongsun Zan's defeat, Tian Yu's friend Xianyu Fu hired him as an adjutant. He recommended that Xianyu Fu join Cao Cao, who subsequently hired Tian Yu as well in various official positions.