ImportanceInfant growth predicts long-term obesity and cardiovascular disease. Previous interventions designed to prevent obesity in the first 2 years of life have been largely unsuccessful. Obesity prevalence is high among traditional racial and ethnic minority groups.ObjectiveTo compare the effectiveness of adding a digital childhood obesity prevention intervention to health behavior counseling delivered by pediatric primary care clinicians.Design, Setting, and ParticipantsIndividually randomized, parallel-group trial conducted at 6 US medical centers and enrolling patients shortly after birth. To be eligible, parents spoke English or Spanish, and children were born after 34 weeks’ gestational age. Study enrollment occurred between October 2019 and January 2022, with follow-up through January 2024.InterventionsIn the clinic-based health behavior counseling (clinic-only) group, pediatric clinicians used health literacy–informed booklets at well-child visits to promote healthy behaviors (n = 451). In the clinic + digital intervention group, families also received health literacy–informed, individually tailored, responsive text messages to support health behavior goals and a web-based dashboard (n = 449).Main Outcomes and MeasuresThe primary outcome was child weight-for-length trajectory over 24 months. Secondary outcomes included weight-for-length z score, body mass index (BMI) z score, and the percentage of children with overweight or obesity.ResultsOf 900 randomized children, 86.3% had primary outcome data at the 24-month follow-up time point; 143 (15.9%) were Black, non-Hispanic; 405 (45.0%) were Hispanic; 185 (20.6%) were White, non-Hispanic; and 165 (18.3%) identified as other or multiple races and ethnicities. Children in the clinic + digital intervention group had a lower mean weight-for-length trajectory, with an estimated reduction of 0.33 kg/m (95% CI, 0.09 to 0.57) at 24 months. There was also an adjusted mean difference of −0.19 (95% CI, −0.37 to −0.02) for weight-for-length z score and −0.19 (95% CI, −0.36 to −0.01) for BMI z score. At age 24 months, 23.2% of the clinic + digital intervention group compared with 24.5% of the clinic-only group had overweight or obesity (adjusted risk ratio, 0.91 [95% CI, 0.70 to 1.17]) based on the Centers for Disease Control and Prevention criteria of BMI 85th percentile or greater. At that age, 7.4% of the clinic + digital intervention group compared with 12.7% of the clinic-only group had obesity (adjusted risk ratio, 0.56 [95% CI, 0.36 to 0.88]).Conclusions and RelevanceA health literacy–informed digital intervention improved child weight-for-length trajectory across the first 24 months of life and reduced childhood obesity at 24 months. The intervention was effective in a racially and ethnically diverse population that included groups at elevated risk for childhood obesity.Trial RegistrationClinicalTrials.gov Identifier: NCT04042467