He hailed from Shujun 蜀郡 (modern Chengdu 成都, Sichuan) and started learning and reading at an early age, but he hid not love commentaries and exegis very much. Yang Xiong was not a very good speaker and discussant and rather loved to think and deliberate in his mind. He was a of a pure and simple character. In an advanced stage of expertise, he only read what he rated as a writing of great value. He was a disciple of Yan Junping 嚴君平 from which he learned the Confucian Classic Yijing 易經 "Book of Changes", the Daoist classic Laozi 老子, as well as writing poems and rhapsodies. He very loved the poetry of Qu Yuan 屈原 and Sima Xiangru 司馬相如 and imitated their style of elegies.
When Yang moved to the capital he soon attracted the attention of Emperor Cheng 漢成帝 (r. 33-7 BCE) who pomoted him to gentleman attendant at the palace gate (jishi Huangmen lang 給事黄門郎), where he became acquainted with high officials like Wang Mang 王莽, Liu Xin 劉歆 and Dong Xian 董賢. During that time he changed his mind and abstained from poetry in favour of philosophy. He was deeply impressed by the Yijing and the Lunyu "Confucian Analects" and started writing books that were exactly modeled like these two Classics. The Yijing was his model for the Taixuanjing 太玄經, and the Lunyu for his book Fayan 法言. Yang Xiong also wrote the gloss books Xunzuan 訓纂, Fangyan 方言 and Cangjie xunzuan 倉頡訓纂.
When Wang Mang usurped the throne of the Han dynasty Yang Xiong was appointed Grand master of palace leisure (zhongsan dafu 中散大夫), but he refused to take part in government which he considered a dirty affair. Instead he studied books in the Tianluge Library 天禄閣 and dedicated himself to the writing of books. Yet he felt the dangers of power when Liu Fen 劉棻, son oft the librarian Liu Xin forged an auspicious writing in ancient script to present it to Wang Mang. The emperor refused to accept it, and Liu Fen was banished. The ancient script drew the attention of Yang Xiong from which Liu Fen had once learnt calligraphy and paleography. Yang was to be arrested and tried to kill himself when the jail officials arrived at his house. His attempt at suicide failed, and Wang Mang pardoned him. From that incident on Yang Xiong refused to have anything to do with politics until the end of his life.
Yang Xiong's most important philosophical books are the Taixuanjing and the Fayan. The Taixuanjing is a theory of worldview that is partially philosophical and partially mantic. It consists of a main text (jing 經) and commentaries (zhuan 傳). Unlike the Yijing, the Taixuanjing is based on a tripartite view of pair, unpair and harmonious (the latter part in unknown in the dual concept of the Yijing). While the Yijing is based on figures, the Taixuanjing operates more with numbers. The origin of the universe ist he great mystery (taixuan 太玄).
The book Fayan explains Yang Xiong's view of society, politics and the human character. It is constructed in a question-and-answer pattern. The Confucian scholar (ru 儒) is an element that connects Heaven, Earth and Man. Only the way of Confucius is able to bring stability and peace to society and state. Any person trying to acheive a state of tranquility has to discard unimportant things and to concentrate on what is essential for the cultivation of the self. The human character is always a mixture of good and bad and has to be purified by the cultivation of the self. The highest and basic virtue is filial piety.