Vilhelm Hammershøi was born in 1864 in Copenhagen, Denmark. The son of a well-to-do merchant, Christian Hammershøi, and his wife, Frederikke (née Rentzmann), Hammershøi studied drawing from the age of eight with Niels Christian Kierkegaard and Holger Grønvold, as well as painting with Vilhelm Kyhn, before embarking on studies with Frederik Vermehren and others at the Royal Danish Academy of Fine Arts. From 1883 to 1885, he studied with Peder Severin Krøyer at the Independent Study Schools, then debuted in the Charlottenborg Spring Exhibition in 1885 with Portrait of a Young Girl (his sister, Anna; Pierre-Auguste Renoir is reported to have admired this painting). Hammershøi married Ida Ilsted in 1891.
Hammershøi worked mainly in his native city, painting portraits, architecture, and interiors. He also journeyed to the surrounding countryside and locations beyond, where he painted rolling hills, stands of trees, farm houses, and other landscapes. He is most celebrated for his interiors, many of which he painted in Copenhagen at Strandgade 30 (where he lived with his wife from 1898 to 1909, and Strandgade 25 (where they lived from 1913 to 1916). He travelled widely in Europe, finding London especially atmospheric in providing locations for his highly understated work, suffused as it was at the time with a foggy, coal smoke polluted atmosphere. His work in consequence has been described as "Monet meets the Camden School".
Hammershøi's wife figures in many of his interiors, often depicted from behind. Ida is also the model in many similar works by her brother, Peter Ilsted. Peter and Vilhelm were lifelong friends, business partners, and colleagues. The Metropolitan Museum of Art held an exhibition of their collective works in 2001, and there was an exhibition of his works in 2008 at the Royal Academy of London.