To assess the difference in prevalence of sleep problems and insomnia in patients with knee or hip osteoarthritis (OA), and explore characteristics associated with sleep problems and insomnia. We included 8,162 knee/hip OA patients enrolled in supervised exercise and patient education through the Good Life with osteoArthritis in Denmark (GLA:D®) program. We assessed presence of sleep problems (yes/no), followed by the Insomnia Severity Index 3-item (ISI-3) questionnaire among those with sleep problems (Insomnia: ISI-3 score ≥ 7). Characteristics associated with sleep problems/insomnia was estimated for knee and hip OA patients separately (prevalence ratios [PR]). In total, 68% (n = 3,539) and 64% (n = 1,807) of knee and hip OA patients reported sleep problems, respectively, corresponding to a PR of 1.06 (95% CI 1.03 to 1.10). Prevalence of insomnia was 17% (n = 943) and 20% (n = 528) for those with knee and hip OA, respectively (PR 1.18 [95% CI 1.07 to 1.30]). Large overlap between characteristics associated with sleep problems and insomnia were observed. Characteristics most strongly associated with higher prevalence of insomnia were pain intensity ≥40 mm VAS (knee: PR 2.39 [95% CI 2.08 to 2.74]; hip: PR 2.54 [95% CI 2.10 to 3.07], a high number of comorbidities, and analgesic use in both patients with knee and hip OA. Sleep problems and insomnia are highly prevalent among primary care patients with knee and hip OA, and slightly more common in hip OA patients. Prevalence of insomnia was substantially higher among patients with more comorbidities, higher pain intensity and analgesic use.