He was born of Jewish parents in Copenhagen. In 1817 he was sent to the university. His father died in his infancy, and the family property was destroyed in the bombardment of 1807. The boy was brought up by his relative, M. L. Nathanson, a well-known newspaper editor.
Young Hertz passed his examination in law in 1825. But his taste was all for polite literature, and in 1826-1827 two plays of his were produced, Mr. Burchardt and his Family and Love and Policy; in 1828 followed the comedy of Flyttedagen. In 1830 he brought out what was a complete novelty in Danish literature, a comedy in rhymed verse, Amor's Strokes of Genius.
In the same year Hertz published anonymously Gengangerbrevene, or Letters from a Ghost, which he pretended were written by Baggesen, who had died in 1826. The book was written in defence of Johan Ludvig Heiberg, and was full of satirical humour and fine critical insight. Its success was overwhelming; but Hertz preserved his anonymity, and the secret was not known until many years later.
In 1832 he published a didactic poem, Nature and Art, and Four Poetical Epistles. A Day on the Island of Als was his next comedy, followed in 1835 by The Only Fault. Hertz passed through Germany and Switzerland into Italy in 1833; he spent the winter there, and returned the following autumn through France to Denmark.
In 1836 his comedy of The Savings Bank enjoyed a great success. But it was not till 1837 that he gave the full measure of his genius in the romantic national drama of Svend Dyrings Huus, a beautiful and original piece. His historical tragedy Valdemar Aiterdag was not so well received in 1839; but in 1845 he achieved an immense success with his lyrical drama Kong Renes Datter ("King René's Daughter"), which has been translated into almost every European language, and was adapted by Tchaikovsky into his opera Iolanta. This was a highly romanticised account of the life of Yolande, Duchess of Lorraine. To this succeeded the tragedy of Ninon in 1848, the romantic comedy of Tonietta in 1849, A Sacrifice in 1853; The Youngest in 1854.
His lyrical poems appeared in successive collections, dated 1832, 1840 and 1844. From 1858 to 1859 he edited a literary journal entitled Weekly Leaves. His last drama, Three Days in Padua, was produced in 1869, and he died on the 25th of February of the next year.
Hertz is one of the first of Danish lyrical poets. His poems are full of colour and passion, his versification has more witch-craft in it than any other poet's of his age, and his style is grace itself. He has all the sensuous fire of Keats without his proclivity to the antique.
As a romantic dramatist he is scarcely less original. He has bequeathed to the Danish theatre, in Svend Dyrings Huus and King René's Daughter, two pieces which have become classic. He is a troubadour by instinct; he has little or nothing of Scandinavian local colouring, and succeeds best when he is describing the scenery or the emotions of the glowing south.
His Dramatic Works (18 vols) were published at Copenhagen in 1854-1873; and his Poems (4 vols) in 1851-1862.