Dietary diversity is one of the eight core indicators of infant and young child feeding (IYCF) practices. It is also a proxy for nutrient adequacy of the diet of individuals. There are minimal studies showing the level of dietary practice in urban and rural settings comparably. Hence, the present study intended to assess and compare differences in the level of dietary diversity and its contributing factors in urban and rural settings of the West Shoa zone of Oromia, Ethiopia. A community-based comparative cross-sectional study was conducted among 674 pairs of mothers/caregivers and children aged 6–23 months using a multistage sampling technique. Data were analysed and descriptive summaries were presented with tables, charts and graphs. A linear regression analysis was used to identify factors that were associated with the level of dietary diversity. The dietary diversity score (DDS) was 26⋅1 % (95 % CI 22⋅8, 29⋅5) both in urban and rural (P < 0⋅001), and also the minimum meal frequency was 56⋅5 % (95 % CI 52⋅7, 60⋅2) (P < 0⋅038). Child from merchant mother, own production of foods at the household level and frequent advice of IYCF practices during Post natal care (PNC) visit in urban residents, maternal secondary educational level, living with caregiver only, having a merchant father, advice of IYCF practice during PNC visit and utilisation of horse as a means of transportation in rural were positively associated with the level of dietary diversity. Generally, infant and young children who received the recommended dietary diversity and the minimum meal frequency were low in the study area both in the urban and rural settings.