Purpose Although suicide risk in veterans has been widely studied, there is little information on the risk of non-fatal selfharm in this population. We used data from the Scottish Veterans Health Study to conduct an epidemiological analysis of self-harm in veterans, in comparison with people who have never served. Methods We conducted a retrospective, 30-year cohort study of 56,205 veterans born 1945-1985, and 172,741 people with no record of military service, and used Cox proportional hazard models to examine the association between veteran status and cumulative risk of non-fatal self-harm, overall and stratified by birth cohort, sex and length of service. We also examined mental and physical comorbidities, and association of suicide with prior self-harm. Results There were 1620 (2.90%) first episodes of self-harm in veterans, compared with 4212 (2.45%) in non-veterans. The difference was statistically significant overall (unadjusted HR 1.27, 95% CI 1.21-1.35, p < 0.001). The risk was highest in the oldest veterans, and in the early service leavers who failed to complete initial training (unadjusted HR 1.69, 95% CI 1.50-1.91, p < 0.001). The risk reduced with longer service and in the intermediate birth cohorts but has increased again in the youngest cohort. Conclusions The highest risk of non-fatal self-harm was in veterans with the shortest service, especially those who did not complete training or minimum engagement, and in the oldest birth cohorts, whilst those who had served the longest were at reduced risk. The risk has increased again in the youngest veterans, and further study of this subgroup is indicated.