This study evaluates inpatients’ ontological insecurity and daily epidemic prevention behavior during the pandemic and explores the factors influencing daily epidemic prevention behaviors. The outbreak of coronavirus disease (COVID-19) in December 2019 caused a global public health crisis that has affected the very structure of society and the order of daily life. Ontological security is the ability to predict the impact of changes in social environments on personal security, such as during the pandemic. A cross-sectional study was used to collect data from 1185 inpatients of a hospital in Zhejiang, China, from July 11 to August 9, 2021. Our questionnaire recorded information on demographics, ontological insecurity, and daily epidemic prevention behaviors. The Mann-Whitney U test, Kruskal-Wallis H test, Spearman’s correlation analysis, and logistic regression analysis were used to determine the influencing factors of daily epidemic prevention behavior on ontological security. Results showed a negative correlation between inpatients’ ontological insecurity and daily epidemic prevention behavior (r = −.253, P < .001). The logistic regression analysis showed that the independent factors affecting daily epidemic prevention behavior include ontological insecurity (OR: 0.952; 95% CI: 0.937-0.968) ( P < .001), sex (OR: 1.292; 95% CI: 1.004-1.663), age (OR: 0.880; 95%: 0.790-0.980), education (OR: 1.307; 95% CI: 1.098-1.556), and occupation [famers vs civil servants, staff or professional (OR: 0.596; 95% CI: 0.374-0.949),other versus civil servants, staff, or professional (OR: 0.693; 95% CI: 0.503-0.953)] ( P < .05). Inpatients were shown to have good ontological security during the COVID-19 epidemic, younger patients, female patients, patients with stronger ontological security, patients with a higher educational level, and those who work in a fixed unit or organization showed higher levels of daily epidemic prevention behavior. Hospital managers should strengthen the intervention management of epidemic prevention behavior based on patient characteristics.