In May of the following year, Zhang went to Japan and was introduced to Sun Yat-sen by Liang Qichao. He returned to China two months later to be a reporter for the Shanghai-based East Asia Time (亞東時報), and later published a book on politics, Qǐushū (訄書).
In 1901, under the threat of arrest from the Qing Empire, Zhang first escaped to Zhenxi Longquan Temple (鎮西龍泉寺), then became a professor at Soochow University for a year before he escaped to Japan for several months. Upon return, he was arrested for three years until June 1906. After his release, Zhang went to Japan to join Tongmeng Hui and became the chief editor of the newspaper The People Bulletin (民報 Ming Bao) that criticized strongly of the Qing Empire's corruption. He also taught overseas Chinese students of Chinese literature. In 1908, however, The People Bulletin was banned by the Japanese government, so Zhang focused on writing books about the Chinese classics and researched ancient Chinese pronunciation, and tone.
After Wuchang Uprising, Zhang returned to China to establish the Republic of China Alliance (中華民國聯合會) and chief-edit the Great Republic Daily (大共和日報 Dagonghe Ribao).
Based on his study of the classics, Zhang developed a system of fragments and shorthands based on Zhuanshu calligraphy, called the Ziyin Zimu (記音字母), or "Sound-mnemonic Marks", that was later adopted as the basis of Zhuyin established in 1913.
After Yuan Shikai became the President of the Republic of China in 1913, Zhang was his high-ranking advisor for a few months until the assassination of Sung Chiao-jen. After criticizing Yuan for possibly responsible of the assassination, Zhang was jailed until Yuan's death in 1916.
In 1924, Zhang left Kuomintang, entitled himself "The Lost Citizen of the Republic of China" (中華民國遺民) and became critical of Chiang Kai-shek. Zhang established the Mandarin Discussion Society (國學講習會) in Suzhou in 1934 and chief-edited the magazine Standardized Language (制言Zhiyan). He died two years later at 67 and was buried in a state funeral. In April 3, 1955, the People's Republic of China removed the coffin from Suzhou to Nanping Mountain (南屏山麓), Hangzhou. Zhou Enlai spoke of Zhang as "the Pride of us Zhejiang citizens" (是我们浙江人民的骄傲). In addition, the People's Republic established a museum devoted to him beside Xi Lake.
Zhang married Tan Guoli (湯國梨) in 1913. They later had two sons: Zhang Dao (章導) and Zhang Qi (章奇).