Epidemiological evidence supports vitamin D deficiency as a risk factor for tuberculosis. Differences in solar ultraviolet B (UV-B) exposure, the major source of vitamin D, might therefore partially explain global variation in tuberculosis incidence. In a global country-based ecological study, we explored the correlation between vitamin D-proxies, such as solar UV-B exposure, and other relevant variables with tuberculosis incidence, averaged over the period 2004-2013. Across 154 countries, annual solar UV-B exposure was associated with tuberculosis incidence. Tuberculosis incidence in countries in the highest quartile of UV-B exposure was 78% (95% CI 57-88%, p<0.001) lower than that in countries in the lowest quartile, taking into account other vitamin D-proxies and covariates. Of the explained global variation in tuberculosis incidence, 6.3% could be attributed to variations in annual UV-B exposure. Exposure to UV-B had a similar, but weaker association with tuberculosis notification rates in the multilevel analysis with sub-national level data for large countries (highest versus lowest quartile 29% lower incidence; p=0.057). The potential preventive applications of vitamin D supplementation in high-risk groups for tuberculosis merits further investigation.