Goal setting aids health-related behavior changes; however, the influence of different types of goals on weight loss remains unclear. We aimed to investigate the association of 3 aspects of goal setting with weight and program dropout over a 24-week period. This study was a prospective longitudinal analysis of participants in a 12-week digital behavioral weight loss program. Weight and engagement data for eligible participants (N=36,794) were extracted from the database. Eligible participants were adults in the United Kingdom who had enrolled in the program, had a BMI ≥25 kg/m2, and a weight reading recorded at baseline. Three aspects of goal setting were self-reported at enrollment: weight loss motivation (appearance, health, fitness, or self-efficacy), overall goal preference (low, medium, or high), and percentage weight loss goal (<5%, 5%-10%, or >10%). Weight was measured at 4, 12, and 24 weeks. Mixed models for repeated measures were used to explore the association between goals and weight across the 24-week period. To measure sustained weight change, the primary outcome was weight at 24 weeks. We explored dropout rates over the 24-week period by goal and whether engagement mediated the association between goals and weight loss. Of the 36,794 participants (mean 46.7, SD 11.1 years; 33,902/36,794, 92.14% female) included in the cohort, 13.09% (n=4818) reported weight at 24 weeks. Most participants set goals of 5%-10% weight loss (23,629/36,794, 64.22%), but setting goals for >10% was associated with greater weight loss (mean difference 5.21 kg, 95% CI 5.01-5.41; P<.001). There was no difference between goals of 5%-10% and <5% (mean difference 0.59 kg, 95% CI 0.00-1.18; P=.05). Appearance was the most prevalent motivational factor (14,736/36,794, 40.05%), but health and fitness were associated with greater weight losses (mean difference health vs appearance 1.40 kg, 95% CI 1.15-1.65; P<.001 and mean difference fitness vs appearance 0.38 kg, 95% CI 0.05-0.70; P=.03). Goal preference had no association with weight. Engagement was an independent predictor of weight loss but not a mediator of the effect of goal setting. At 24 weeks, those who set goals of >10% were less likely to drop out compared with 5%-10% goals (odds ratio [OR] 0.40, 95% CI 0.38-0.42; P<.001); those who liked to set overall high goals were more likely to drop out compared with medium goals (OR 1.20, 95% CI 1.11-1.29; P<.001); and those motivated by fitness or health were less likely to drop out compared with appearance (OR 0.92, 95% CI 0.85-0.995; P=.04 and OR 0.84, 95% CI 0.78-0.89; P<.001, respectively). Setting higher weight loss goals and being motivated by health or fitness were associated with greater weight loss and lower likelihood of dropout. Randomized trials for setting these types of goals are required to confirm causality.