The film is based on Thomas Vinterberg's play of the same name, which is inspired by his colourful childhood in an academic commune north of Copenhagen.
Thomas Vinterberg wrote the part of Emma specifically for Helene Reingaard Neumann, his wife in real life. Emma is a mirror version of Anna (played by Trine Dyrholm. Vinterberg and Neumann began a relationship on the set of When a Man Comes Home (2007), when Vinterberg was married to Maria Walbom. Vinterberg told in interview with The Globe and Mail in May 2017 that he had to be fair to the women of this film, he had to be sharing with them and deliver the ugly sides of being a man.