He studied law and theology in Sárospatak, and subsequently at Budapest; and, after many vicissitudes, at the age of thirty he accepted the post of Protestant minister in Beje, a small village in his native county, whence, in two years, he removed to Kelemér, and four years later to Hanva, in the county of Borsod, where he remained till his death. 
At the age of four-and-twenty Tompa published his first poems in the Athenaeum, which soon procured for him a high reputation. His first volume, Népregék, népmondák ("Folk-Legends and Folk-Tales"), in 1846, met with great success, and the same may be said of the first volume of his Poems in 1847.
He took part in the Hungarian Revolution of 1848, acting as field chaplain to the volunteers of his county and seeing several battles; but the unfortunate close of that heroic struggle silenced his poetic vein for a considerable time, and when in 1852 and 1853 he gave vent to his patriotic grief in some masterly allegories on the state of oppressed Hungary, he was twice arrested by the Austrian authorities. He married Emilia Zsoldos in 1849.
After being released he published his Virágregék ("Legends of Flowers"), a collection of poems showing great imagination and love of nature. Soon after this he became oppressed with melancholy and abandoned this branch of poetry. He published three volumes of sermons, which, says his biographer, Károly Szász, Protestant bishop of Budapest, are among the best in Hungarian literature, and will favourably compare with those of Robertson, Monod or Parker. His collected poetical works were published at Budapest in 1870, and again in 1885.