Histone deacetylase inhibitors, including valproic acid, selectively induce cellular differentiation and apoptosis in melanoma cells. No published pharmacoepidemiology studies have explored the association between valproic acid use and melanoma risk. We conducted a retrospective cohort study of adult white Kaiser Permanente Northern California members (n=2,213,845) from 1997-2012 to examine the association between valproic acid use and melanoma risk. Melanoma hazard ratios (HRs) and 95% confidence intervals (CIs) were estimated using Cox proportional hazards models, adjusted for age, sex, calendar year and healthcare use. Melanoma incidence was lower among exposed individuals (64.0 exposed versus 96.2 unexposed per 100,000 person-years, p <0.001). Exposed individuals had a lower incident melanoma risk (HR= 0.64; 95% CI 0.51-0.79) in unadjusted analysis, and the estimate was attenuated but significant in adjusted analysis (HR= 0.76, 95% CI: 0.61-0.94). Cumulative exposure based on number of fills revealed a biologically implausible inverse dose-effect. Exposed individuals were more likely to present with local, as compared to regional or distant disease at diagnosis (97.6% exposed vs. 92.6% unexposed). Our findings suggest that valproic acid exposure may be associated with decreased melanoma risk and progression, but the cumulative exposure analyses suggest the observation may be due to residual confounding.