Zhang Fan was born in the Eastern Han dynasty in Xiuwu County, Henei Commandery, which is present-day Huojia County, Henan. His grandfather, Zhang Xin, served as Minister over the Masses in the Han imperial court, while his father, Zhang Yan, served as Grand Commandant. Yuan Wei, the Grand Tutor, wanted to arrange for his daughter to marry Zhang Fan, but Zhang Fan declined. Zhang Fan desired a quiet, peaceful and happy life. As he had little regard for fame and material wealth, he rejected offers and invitations to serve in the Han government. He had two younger brothers, Zhang Cheng and Zhang Zhao. Around 190, Zhang Fan and his family relocated to Yang Province after the warlord Dong Zhuo seized control of the Han central government and held the figurehead Emperor Xian hostage. In the 190s, the warlord Yuan Shu controlled the lands around the Huai River in Yang Province. He had heard of Zhang Fan and wanted to recruit him as an adviser. However, Zhang Fan claimed that he was ill and refused to go. Yuan Shu did not force him. Zhang Fan then sent his brother Zhang Cheng to meet Yuan Shu instead. Around 207, after the warlord Cao Cao had defeated his rivals in northern China and unified the region under his control, he sent a messenger to invite Zhang Fan to serve in the Han government. However, Zhang Fan claimed that he was ill and remained behind in Pengcheng. He sent his brother Zhang Cheng to meet Cao Cao instead. On one occasion, Zhang Fan's son Zhang Ling and nephew Zhang Jian were kidnapped by bandits in Shandong. When Zhang Fan asked them to release the boys, they freed only Zhang Ling. Zhang Fan then asked them if he could trade his son for his nephew instead because his nephew was younger. The bandits were so impressed by his act of sacrifice that they released both Zhang Ling and Zhang Jian. In 209, after Cao Cao returned from the Battle of Red Cliffs, he met Zhang Fan inChen Commandery and appointed him as a Consultant and Army Adviser. Cao Cao highly regarded Zhang Fan and treated him respectfully. When he went on military campaigns against rival warlords, he often left Zhang Fan and Bing Yuan behind to guard his base together with his son and heir apparent, Cao Pi. He also once told Cao Pi, "You should consult these two men before you do anything." Cao Pi heeded his father's advice and treated them as if they were the elders of his family. Zhang Fan kept no surplus wealth for himself and his family. He generously used his personal wealth to help the poor and needy, and provided shelter for many widows and orphans. He neither rejected the gifts he received from others nor used them, and instead kept them somewhere. After he died in 212, his family returned the gifts in accordance with his final wishes.
Family
In late 220, more than half a year after Cao Cao's death, Cao Pi usurped the throne from Emperor Xian, ended the Eastern Han dynasty, and established the Cao Wei state with himself as the new emperor. After his coronation, Cao Pi appointed one of Zhang Fan's sons, Zhang Shen, as a Palace Gentleman. Apart from Zhang Shen, Zhang Fan was known to have at least one other son, Zhang Ling.