Background: The glycolytic nature of cancer cells presents a potential treatment target that may be addressed by a ketogenic diet (KD). Objective: We hypothesized that a KD would improve body composition and lower serum insulin and insulin-like growth factor-I (IGF-I) in women with ovarian or endometrial cancer. Methods: In this randomized controlled trial, women with ovarian or endometrial cancer [age: ≥19 y; body mass index (kg/m2): ≥18.5] were randomly assigned to a KD (70:25:5 energy from fat, protein, and carbohydrate) or the American Cancer Society diet (ACS; high-fiber, low-fat). Body composition (DXA) and fasting serum insulin, IGF-I, and β-hydroxybutyrate were obtained at baseline and at 12 wk; urinary ketones were also measured throughout the intervention. We assessed differences between the diets with ANCOVA and independent t tests. We used correlation analyses to estimate associations between changes in serum analytes and body composition. Results: After 12 wk, the KD (compared with ACS) group had lower adjusted total (35.3 compared with 38.0 kg, P < 0.05) and android (3.0 compared with 3.3 kg, P < 0.05) fat mass. Percentage of change in visceral fat was greater in the KD group (compared with the ACS group; -21.2% compared with -4.6%, P < 0.05). Adjusted total lean mass did not differ between the groups. The KD (compared with ACS) group had lower adjusted fasting serum insulin (7.6 compared with 11.2 µU/mL, P < 0.01). There was a significant inverse association between the changes in serum β-hydroxybutyrate and IGF-I concentrations (r = -0.57; P < 0.0001). Conclusions: In women with ovarian or endometrial cancer, a KD results in selective loss of fat mass and retention of lean mass. Visceral fat mass and fasting serum insulin also are reduced by the KD, perhaps owing to enhanced insulin sensitivity. Elevated serum β-hydroxybutyrate may reflect a metabolic environment inhospitable to cancer proliferation. This trial was registered at www.clinicaltrials.gov as NCT03171506.