He hailed from Daliang 大梁 (modern Kaifeng 開封, Henan) and was a wandering scholar of the state of Wei 魏 at the end of the Warring States period 戰國 (5th cent.-221 BCE), as a retainer of Lord Xinling 信陵君. Be became rich by marriage and had contact with a lot of merchants, relations that helped him obtaining the post of magistrate (ling 令) of Waihuang 外黃. When the state of Qin conquered Wei, he disappeared in secrecy because a prize was offered for his head.
When Chen Sheng 陳勝 rebelled against the Qin dynasty, Zhang Er and his comrade Chen Yu 陳餘 rose weapons. Zhang Er became commandant (xiaowei 校尉) and conquered the territory of ancient Zhao 趙 (approx. modern Shanxi) with the city of Handan 邯鄲. He made Wu Chen 武臣 king of Zhao, himself being his chief counsellor (chengxiang 丞相). In this position he was able to dominate Wu Chen, independently of Chen Sheng.
Zhang expanded the territory of Zhao towards the north. After the death of Wu Chen he made Zhao Xie 趙歇 king of Zhao. When Zhang Er's army was besieded by the Qin general Zhang Han 章邯 at Julu 巨鹿 (modern Pingxiang 平鄉, Hebei), Chen Yu refused to send a relief army, provoking Zhang Er's hatred. Later on, Zhang joined the warlord Xiang Yu and entered with him the capital of the Qin dynasty, Xianyang 咸陽. Zhang was therefore invested by Xiang Yu as king of Changshan 常山.
In 205 he was defeated by Chen Yu's army and changed sides, becoming an ally of Liu Bang 劉邦, the eventual founder of the Han dynasty 漢 (206 BCE-220 CE) . He served as a commander in the army of Han Xin 韓信, conquered the region of Zhao and had executed his rival Chen Yu and the king of Zhao, Zhao Xie. Liu Bang made Zhao Er King of Zhao, yet Zhang Er died soon.