Adequate consumption of diversified food during pregnancy enables adequate intake of 11 important micronutrients. Pregnant women who consume an inadequate amount of diversified food during pregnancy are at a higher risk of delivering preterm babies, stillbirth, low birth weight, and small for gestational age newborns. This study aimed to assess dietary diversity (DD) and associated factors among pregnant women attending antenatal care (ANC) at public hospitals in North Shewa, Oromia, Ethiopia, 2023. An institution-based cross-sectional study was conducted on 400 pregnant women attending antenatal care. The study participants were selected using a systematic random sampling method. A pre-tested, structured, and interviewer-administered questionnaire was used to collect information about dietary diversity. The questionnaire was adapted from a validated and modified individual dietary diversity guideline, as recommended by the Food and Agriculture Organization (FAO) of the United Nations. The household food security level was determined using a standard set of questions derived from the Household Food Insecurity Access Scale (HFIAS) measurement guide. The data were entered into EpiData version 4.6 software and exported to Statistical Package for the Social Sciences (SPSS) version 24 for analysis. The results from the bivariate analysis of p < 0.25 were moved to the multivariable logistics regression analysis model. Any statistical test with a p < 0.05 at a 95% confidence interval (CI) was considered statistically significant. The study revealed that 55.4% of the pregnant women had adequate dietary diversity. Being an urban dweller [adjusted odds ratios (AOR = 2.4. 95% CI: 1.1, 5.18)], being a housewife (AOR = 3.44, 95% CI: 1.37, 8.68), being employed (AOR = 3.69, 95% CI: 1.12, 12.16), being a merchant (AOR = 3.43, 95% CI: 1.15, 10.24), being a daily laborer (AOR = 3.66, 95% CI: 1.0, 13.45), having a low average monthly household income of <500 Ethiopian birr (ETB) (AOR = 0.25, 95% CI: 0.07, 0.83), practicing home gardening (AOR = 2.5, 95% CI: 1.39, 4.5), meal frequency being three or more times per day (AOR = 2.9, 95% CI: 1.64, 5.09), and receiving dietary counseling during antenatal care (AOR = 3.56, 95% CI: 2.0, 6.35) were factors associated with the dietary diversity of the pregnant women. This study found that 55.4% of the pregnant women had adequate dietary diversity. Place of residence, women's occupation, average monthly household income, practicing home gardening, meal frequency per day, and receiving dietary counseling during antenatal care were strong predictors of adequate dietary diversity among pregnant women. Therefore, attention should be paid to pregnant women's diet by healthcare providers during antenatal care.