Cytochrome P450 (CYP) 2C19 plays a role in the biotransformation of clinically relevant drugs as well as endogenous compounds, including sex hormones, which are known to be modulators of food intake and energy balance in humans. We attempted to investigate the influence of CYP2C19 polymorphisms on valproic acid (VPA)-induced weight gain. This retrospective longitudinal study included 85 VPA-treated and 93 carbamazepine (CBZ)-treated (as a reference) young patients with epilepsy. The body mass index (BMI) gap between the patient's BMI and the cutoff value for being overweight was calculated in each patient during the follow-up period. The longitudinal associations of the CYP2C19 genotype with the BMI gap and risk for becoming overweight during VPA or CBZ therapy were examined retrospectively using the generalized estimating equations approach and the Kaplan-Meier method. During the follow-up period, the values of the BMI gap were significantly greater (P = 0.002 or P = 0.005) and the cumulative incidence of becoming overweight tended to be higher (P = 0.032) in the VPA-treated female patients with one or two loss-of-function CYP2C19 alleles than in the females without the loss-of-function CYP2C19 alleles. No associations were observed among the VPA-treated male patients and CBZ-treated male and female patients (P > 0.05). This is the first report to show a relationship between the CYP2C19 polymorphism and VPA-induced weight gain in female patients with epilepsy. Further investigations are needed to verify these findings.