Aim More women than ever before use medication during pregnancy. This use of medications is associated with maternal demographic characteristics, but the nature of the associations is not well documented, especially in relation to polypharmacy. This study describes the medication use during pregnancy in relation to maternal age, Body Mass Index (BMI), smoking, parity, ethnic origin, and socioeconomic classification. Methods This was a Danish nationwide registry study comprising 698,447 clinically recognised pregnancies with gestational age ≥ 10 weeks. This study was conducted in the 2008-2018 period. Medication use was estimated based on the prescription redemption during pregnancy and stratified by maternal demographic characteristics. Results Overall, 60.3% of all pregnant women redeemed at least one prescription during pregnancy, and 28.9% redeemed multiple medications. When stratified by maternal demographic characteristics, use of medication was higher among women aged ≥35 years (65.1%), those with a BMI ≥ 30 kg/m2 (68.6%), smokers (66.0%), multipara (62.4%), Black women (64.5%), and those on early retirement (78.8%). A similar pattern was seen for polypharmacy. Anti-infectives were the most frequently used medication in all subgroups. The types of medications used in combination differed with maternal age, BMI, ethnicity, and socioeconomic classification; especially women on early retirement had a different combination pattern. Conclusion Use of one or multiple medications during pregnancy was highest among women above 35 years of age, women with obesity, smokers, Black women, and early retirees. Early retirees had a distinct prescription pattern, which potentially increased their risk of teratogenicity and maternal adverse effects.