Ding Yi was from Pei State, which is around present-day Suixi County, Anhui. His father, Ding Chong, was an old acquaintance of Cao Cao, the warlord who controlled the Han central government and the figurehead Emperor Xian from 196 to 220. Ding Chong served as the Colonel-Director of Retainers in Cao Cao's administration. After Ding Chong's death, Cao Cao wanted to arrange for Ding Yi to marry one of his daughters, Princess Qinghe. However, Cao Cao's eldest surviving son, Cao Pi, strongly opposed because Ding Yi had an eye disorder which affected his physical appearance and hence made him an unsuitable spouse for Princess Qinghe. Cao Pi then suggested to his father to let Princess Qinghe marry Xiahou Mao instead; Cao Cao agreed. Ding Yi hated Cao Pi for spoiling his chance of becoming Cao Cao's son-in-law, so he grew determined to oppose Cao Pi. He became close to Cao Pi's younger brotherCao Zhi, who was Cao Pi's rival in a power struggle over the succession to their father's position as a vassal king under the Han Empire. Along with Yang Xiu and others, Ding Yi often sang praises of Cao Zhi in front of Cao Cao in the hope of helping Cao Zhi earn his father's favour. However, Cao Zhi ultimately lost to Cao Pi, whom Cao Cao officially designated as his heir apparent. Cao Cao initially assigned Ding Yi to be an Assistant Officer in the West Bureau. After Cao Pi became the heir apparent, Ding Yi was reassigned to be a Right Assistant Security Officer. Cao Cao noted Ding Yi's literary talent and once regretted his decision to not have Ding Yi as a son-in-law. In 220, following Cao Cao's death, Cao Pi inherited his father's position as a vassal king of the Han Empire and eventually usurped the throne from Emperor Xian later that year and established the state of Cao Wei to replace the Eastern Han dynasty. One of the first things he did after coming to power was to have Ding Yi and his entire family executed.
Family
Ding Yi had a similarly named younger brother, Ding Yi, whose courtesy name was Jingli.