Zhang Wenguan (張文瓘) (606 – September 30, 678[1]), courtesy name Zhigui (稚圭), was an official of the Chinese Tang dynasty, serving as a chancellor during the reign of Emperor Gaozong.
Early in the reign of Emperor Taizong of Tang (r. 626–649), Zhang passed the imperial examination and was made a military advisor to the secretary general of Bing Prefecture (并州, roughly modern Taiyuan, Shanxi), Li Shiji.
At that time, his older brother Zhang Wencong (張文琮) was serving as the deputy minister of census—and the departments of public works and census were both under the executive bureau of government (尚書省, Shangshu Sheng).
As of 667, he was serving at the examination bureau, when Emperor Gaozong gave him the designation of Tong Dong Xi Tai Sanpin (同東西臺三品), making him a chancellor de facto.
In 672, Zhang was made the chief judge at the supreme court and continued to serve as chancellor as well as a member of the staff of Emperor Gaozong's crown prince Li Hong.
When he was ill, the prisoners awaiting review were praying for his health, and he was compared to Dai Zhou, another famed chief judge who served during Emperor Taizong's reign.
In 675, he was made Shizhong (侍中), the head of the examination bureau (which by this point had been renamed Menxia Sheng (門下省)) and a post considered one for a chancellor, and also continued to serve on Li Hong's staff as an advisor.