Chronic gastritis (CG) and osteoporosis (OP) are common and occult diseases in the elderly and the relationship of these two diseases have been increasingly exposed. We aimed to explore the clinical characteristics and shared mechanisms of CG patients combined with OP. In the cross-sectional study, all participants were selected from BEYOND study. The CG patients were included and classified into two groups, namely OP group and non-OP group. Univariable and multivariable logistic regression methods were used to evaluate the influencing factors. Furthermore, CG and OP-related genes were obtained from Gene Expression Omnibus (GEO) database. Differentially expressed genes (DEGs) were identified using the GEO2R tool and the Venny platform. Protein–protein interaction information was obtained by inputting the intersection targets into the STRING database. The PPI network was constructed by Cytoscape v3.6.0 software again, and the key genes were screened out according to the degree value. Gene function enrichment of DEGs was performed by Webgestalt online tool. One hundred and thirty CG patients were finally included in this study. Univariate correlation analysis showed that age, gender, BMI and coffee were the potential influencing factors for the comorbidity (P < 0.05). Multivariate Logistic regression model found that smoking history, serum PTH and serum β-CTX were positively correlated with OP in CG patients, while serum P1NP and eating fruit had an negative relationship with OP in CG patients. In studies of the shared mechanisms, a total of 76 intersection genes were identified between CG and OP, including CD163, CD14, CCR1, CYBB, CXCL10, SIGLEC1, LILRB2, IGSF6, MS4A6A and CCL8 as the core genes. The biological processes closely related to the occurrence and development of CG and OP mainly involved Ferroptosis, Toll-like receptor signaling pathway, Legionellosis and Chemokine signaling pathway. Our study firstly identified the possible associated factors with OP in the patients with CG, and mined the core genes and related pathways that could be used as biomarkers or potential therapeutic targets to reveal the shared mechanisms.