Observational studies suggest that 25-hydroxy vitamin D (25(OH)D) concentration is inversely associated with pain. However, findings from intervention trials are inconsistent. We assessed the effect of vitamin D supplementation on pain using data from a large, double-blind, population-based, placebo-controlled trial (the D-Health Trial). 21 315 participants (aged 60–84 years) were randomly assigned to a monthly dose of 60 000 IU vitamin D3 or matching placebo. Pain was measured using the six-item Pain Impact Questionnaire (PIQ-6), administered 1, 2 and 5 years after enrolment. We used regression models (linear for continuous PIQ-6 score and log-binomial for binary categorisations of the score, namely ‘some or more pain impact’ and ‘presence of any bodily pain’) to estimate the effect of vitamin D on pain. We included 20 423 participants who completed ≥1 PIQ-6. In blood samples collected from 3943 randomly selected participants (∼800 per year), the mean (sd) 25(OH)D concentrations were 77 (sd 25) and 115 (sd 30) nmol/l in the placebo and vitamin D groups, respectively. Most (76 %) participants were predicted to have 25(OH)D concentration >50 nmol/l at baseline. The mean PIQ-6 was similar in all surveys (∼50·4). The adjusted mean difference in PIQ-6 score (vitamin D cf placebo) was 0·02 (95 % CI (−0·20, 0·25)). The proportion of participants with some or more pain impact and with the presence of bodily pain was also similar between groups (both prevalence ratios 1·01, 95 % CI (0·99, 1·03)). In conclusion, supplementation with 60 000 IU of vitamin D3/month had negligible effect on bodily pain.