Currently, the COVID-19 outbreak is spreading fast in 185 countries and has engaged most people around the world. COVID-19 imposes severe and tragic consequences on people's health due to the high rate of spread and potentially fatal impacts. In this study, the association of socio-economic factors with food security and dietary diversity is assessed before and during the COVID-19 pandemic. Data from 299 respondents were collected by an online standard questionnaire. Household Dietary Diversity Score (HDDS) and Household Food Insecurity Access Scale (HFIAS) were calculated. A multinomial regression model was applied to determine factors associated with HDDS and HFIAS before and during COVID-19 outbreak. Food security of Iranian households improved during the initial COVID-19 pandemic period (P < 0.001). Households reduced consumption of some food groups during the COVID-19 pandemic compared to the pre-COVID-19 period. Key socio-economic factors associated with food insecurity during the COVID-19 pandemic included personal savings, household income, employment status of head of household, and nutrition knowledge of head of household. During the COVID-19 outbreak, household size, head of household's occupation, personal savings, and number of male children were significantly associated with dietary diversity. Distributing free food baskets to poor households, extending e-marketing, providing nutrition consultations, and organizing donations to support infected households may increase household dietary diversity and improve food security status during a pandemic such as COVID-19. Vulnerable populations in countries experiencing food insecurity, such as Iran, should be supported - not just by providing medical care and personal protective equipment, but also with flexible safety nets and food-based intervention programs to respond to population needs.