Dreyer was born in Copenhagen. His father, Lieutenant General John Christopher Dreyer, was the Danish Minister for War and the Navy. When he was 14 he became interested in astronomy and regularly visited Hans Schjellerup at the Copenhagen observatory. He was educated in Copenhagen but in 1874, at the age of 22, he went to Parsonstown, Ireland. There he worked as the assistant of Lord Rosse (the son and successor of the Lord Rosse who built the Leviathan of Parsonstown telescope).
During 1878 he moved to Dunsink, the site of the Trinity College Observatory of Dublin University to work for Robert Stawell Ball. In 1882 he relocated again, this time to Armagh Observatory, where he served as Director until his retirement in 1916. In 1885 he became a British citizen. In 1916 he and his wife Kate moved to Oxford where Dreyer worked on editing the works of Tycho Brahe.
He won the Gold Medal of the Royal Astronomical Society in 1916 and served as the society's president from 1923 until 1925. He died on September 14, 1926 in Oxford.
Dreyer compiled the New General Catalogue of Nebulae and Clusters of Stars, basing it on William Herschel's Catalogue of Nebulae, as well as two supplementary Index Catalogues. The NGC and IC catalogue designations are still widely used.
Dreyer was also a historian of astronomy. In 1890 he published a biography of Danish astronomer Tycho Brahe, and in his later years he edited Tycho's publications and unpublished correspondence. These were published in a 15-volume edition, Opera Omnia, the last volume of which was published after his death.
His book History of the Planetary Systems from Thales to Kepler (1905), is currently printed with the title A History of Astronomy from Thales to Kepler.