He hailed from Yingchuan 潁川 (modern Yuxian 禹縣, Henan) and entered the palace service as *secretarial palace attendant (jishi shengzhong 給事省中). During the reign of Emperor Huan 漢桓帝 (r. 146－167) he was made palace attendant (xiao huangmen 小黃門). Under Emperor Ling 漢靈帝 (r. 167-189) he rose to the post of Palace Attendant-in-ordinary (zhongchangshi 中常侍) and was bestowed the title of a marquis (liehou 列侯), and gained an important position among the court eunuchs, side by side with Cao Jie 曹節 and Wang Fu 王甫.
After the death of the former, Zhang Rang was appointed court revenue supervisor. He controlled financial channels and had greatest influence on critical decisions at the inner court. Zhang Rang was called the head of the "Ten Palace Attendants" (shi changshi 十常侍), a group of eunuchs controlling the court under Emperor Ling. This group included the eunuchs Zhao Zhong 趙忠, Xia Yun 夏惲, Guo Sheng 郭勝, Sun Zhang 孫璋, Bi Lan 畢嵐, Li Song 栗嵩, Duan Gui 段珪, Gao Wang 高望, Zhang Gong 張恭, Han Kui 韓悝 and Song Dian 宋典). Zhang's family members occupied posts throughout the provinces of the empire, accumulated greatest wealth, and were known as notorious evil-doers.
Gentleman of the interior (langzhong 郎中) Zhang Jun 張鈞 memorialized to the throne, asking to execute the dozen of eunuchs because of corruption, embezzlement and the abuse of power. Zhang Rang thereupon displayed utmost repentence, asked to be thrown into jail and offered to contribute his money for the suppression of the Yellow Turban rebellion 黃巾起義. The Emperor trusted the eunuch as he would trust "his own father", as well as their accusation that Zhang Jun secretly conspired with the rebels, and had him arrested. When the Southern Palace 南宮 was destroyed by fire, Zhang Rang suggested levying extra taxes to rebuilt it. He also personally toured several commanderies in search of suitable timber and stones. During this business he extorted money and building material from the local authorities.
The governor (taishou 太守) of the commandery of Julu 鉅鹿, Sima Zhi 司馬直, was forced to commit suicide, when he refused to participate in the eunuch's game. Only when Emperor Ling died, the commandant in the Capital Army (zhongjun xiaowei 中軍校尉) Yuan Shao 袁紹 dared to raise weapons against the eunuchs. He joined with General-in-chief (da jiangjun 大將軍) He Jin 何進 to kill the eunuchs, yet his plan was reveiled, and the Ten Palace Attendants managed to kill He Jin, but Yuan Shao invaded the palace and massacred all eunuchs.
Zhang Rang himself was able to flee, taking the Infant Emperor Liu Bian 劉辯 (Shaodi 少帝, r. 188-189) as a hostage, but he then gave up and threw himself into the Yellow River.