Background This study aimed to explore the factors associated with the length of in-hospital stay (LOS) in allergic rhinitis (AR). Methods Patients with AR and related data were identified from the Medical Information Mart for Intensive Care IV (MIMIC-IV) database. The influencing factors of LOS were determined by correlation analysis and linear regression. We ranked the importance of significant variables. Finally, mediation analysis was performed to explore the potential mediating factors associated with LOS. Results This retrospective study enrolled 937 patients diagnosed with AR. Correlation analysis showed that 10 variables were closely correlated with the LOS. Linear regression further showed that albumin, white blood cell (WBC), red blood cell (RBC), red cell distribution width (RDW), total Ca, and monocyte were independently related to the LOS (all P < 0.05). After considering comorbidities, monocyte, albumin, WBC, RBC, total Ca, and Charlson comorbidity index were independent factors for LOS (all P < 0.05). The permutation importance exhibited that monocyte was the most important variable. Finally, mediation analysis demonstrated that WBC played a mediating role in the relationship between monocytes and LOS. Conclusion Monocyte level is related to the LOS of patients with AR, and their relationship can be mediated by WBC. Medical and nursing staff can stratify AR management according to monocyte levels to make crucial clinical decisions and shorten LOS. Clinical trial Not applicable.