Hofmannsthal was born in Landstraße, Vienna, the son of an upper-class Christian Austrian mother, Anna Maria Josefa Fohleutner (1852–1904), and a Christian Austrian–Italian bank manager, Hugo August Peter Hofmann, Edler von Hofmannsthal (1841–1915).
His grandfather was Augustin Emil Hofmann von Hofmannsthal and his great-grandfather was Isaak Löw Hofmann, Edler von Hofmannsthal, from whom his family inherited the noble title "Edler von Hofmannsthal", was a Jewish tobacco farmer ennobled by the Austrian emperor.
He was schooled in Vienna at Akademisches Gymnasium, where he studied the works of Ovid, later a major influence on his work. He began to write poems and plays from an early age. Some of his early works were written under pseudonyms, such as Loris Melikow and Theophil Morren, because he was not allowed to publish as a student. He met the German poet Stefan George at the age of seventeen and had several poems published in George's journal, Blätter für die Kunst. He studied law and later philology at the University of Vienna but decided to devote himself to writing upon graduating in 1901. Along with Peter Altenberg and Arthur Schnitzler, he was a member of the avant garde group Young Vienna (Jung–Wien)