He travelled throughout Europe between 1878 and 1885. In Berlin, in 1884, he developed a method for distinguishing between two major classes of bacteria. This technique, the Gram Stain, continues to be an ubiquitous procedure in medical microbiology.
In 1891, Gram taught as a professor at the University of Copenhagen.