This study aims to explore the potential of osteoporosis as a modifiable risk factor for dementia and investigatewhether treatments like estrogen supplementation and bisphosphonates can reduce the risk of dementia in the Thai population. This study aimed to evaluate the risk of dementia in patients with osteoporosis. A cross-sectional analysis was conducted. Participants aged <50 years and those with a history of dementia at baseline were excluded. Clinical variables were analyzed using the chi-squared test. Logistic regression analysis was conducted to determine independent factors of dementia after adjusting for potential confounders. The cohort was conducted on 54,399 participants, of whom 9763 (17.9%) had osteoporosis. The results indicated that individuals with osteoporosis had an odds ratio (OR) of 1.62-fold higher risk of developing dementia compared to those without osteoporosis (95% confidence interval (CI) 1.37-1.92, p-value < 0.001). Furthermore, compared to patients with osteoporosis not undergoing any treatment, those receiving estrogen supplementation and bisphosphonate treatment showed reduced associations with dementia, with an OR of 0.84 (95% CI 0.73-0.98, p-value = 0.023) and 0.66 (95% CI 0.60-0.73, p-value < 0.001), respectively. The study findings suggest an elevated risk of dementia in patients with osteoporosis and contribute substantially to our understanding of the link between osteoporosis and dementia in the Thai population.