Introduction: This population-based cohort study investigates the association between osteoarthritis (OA) and dementia as well as the connection between NSAIDs and dementia. Methods: We chose the samples from the Taiwan Longitudinal Health Insurance Database and then divided them into two groups, which were then matched 1: 1 by propensity score. The first group was the OA group that contained patients with newly diagnosed OA and the second group was the non-OA group. We used the χ2 test, Student t test, Kaplan-Meier analysis, and Cox proportional hazard model for different purposes. Results: The prevalence of dementia in the OA group was higher than that in the non-OA group. The adjusted hazard ratio of the former was 1.42 (95% CI, 1.30–1.54). We also found that etoricoxib and diclofenac might reduce the incidence of dementia. Conclusion: Patients with OA might have a higher risk of dementia. Both etoricoxib and diclofenac might lower the risk of dementia in patients with OA.