Hamerling was born into a poor family at Kirchberg am Walde in Lower Austria. He displayed an early genius for poetry; his youthful attempts at drama excited the interest and admiration of some influential persons. Owing to their assistance young Hamerling was able to attend the gymnasium in Vienna and afterwards the University of Vienna. In 1848 he joined the students' legion, which played a large part in the revolutions of the capital, and in 1849 shared in the defence of Vienna against the imperialist troops of Alfred I, Prince of Windisch-Grätz. After the collapse of the revolutionary movement he was obliged to hide for a couple of weeks to escape arrest. For the next few years he pursued his studies in natural science and philosophy, and in 1855 became master at the Gymnasium at Trieste. For many years he was ill, and in 1866 retired on a pension, which in acknowledgment of his literary works was increased by the government to a sum sufficient to enable him to live carefree until he died at his villa in Stiftingstal near Graz, Austria. A popular edition of Hamerlings works in four volumes was published by M. M. Rabenlechner.
The 1911 Encyclopædia Britannica characterizes Hamerling as one of the most remarkable poets of the modernAustrian school, describing his imagination as rich and his poems as full of life and colour. What it terms his most popular poem, Ahasver in Rom, of which the emperor Nero is the central figure, is said to show at its best what is alleged to be the author's brilliant talent for description. Among his other works, 1911 Britannica mentions Venus im Exil ; Der Königvon Sion, characterized as a generally recognized masterpiece; Die sieben TodsündenBlätter im Winde ; Homunculus ; Amor und Psyche. The 1911 Britannica goes on to describe his novel, Aspasia, as giving a finely-drawn description of the Periclean age, but like his tragedy Danton und Robespierre, somewhat stilted, showing that Hamerling's genius, though rich in imagination, was ill-suited for the realistic presentation of character.