Introduction: About 50-60% of all pregnant women suffer from insomnia during pregnancy. Pregnancy-related insomnia has been associated with severe outcomes for both mother and child postnatally. Currently, the treatment of pregnancy-related insomnia is often neglected due to a lack of suitable treatments. This online assessor-blinded randomized controlled trial aimed to evaluate the effectiveness of music listening and sleep hygiene for treating pregnancy-related insomnia in a Danish population. Methods: We recruited first-time pregnant women at the end of the second trimester with a complaint of poor sleep. Participants in the music group received standard sleep hygiene advice and were instructed to listen to music daily at bedtime for four weeks. They could choose among six sleep playlists of different genres. Participants randomised to the sleep hygiene group received standard sleep hygiene alone. Primary outcomes were sleep quality measured with the Pittsburgh Sleep Quality Index (PSQI) and insomnia severity measured with the Insomnia Severity Index.Results: Among the 98 participants receiving the online intervention 31 participants in the music group (62%) and 40 participants in the sleep hygiene group (80%) completed the post-measurements. Both groups experienced improved sleep quality during the intervention period (PSQI change -2.10, 95% CI -3.27 to -0.93, p < 0.001) with no significant difference between the groups. Similarly, insomnia symptoms were reduced (ISI change -3.42, 95% CI -5.02 to -1.83, p < 0.001) with no significant difference in the effect. There was a significant difference in the compliance between the groups, with 42% of participants in the music group not implementing the sleep hygiene advice. Discussion: Sleep quality and insomnia severity can be improved in pregnant women with relatively simple interventions like music listening and sleep hygiene advice. These results are in line with previous research, but larger trials are recommended to support introduction into clinical practice.