Although female infants may have an early life biological advantage over males, gendered treatment can alter health outcomes. Ecuador has an unusually high ratio of male to female infant mortality, but gender norms have been reported to favor boys. This analysis of baseline data from the Lulun Project, a randomized controlled trial conducted in rural Andean communities of Ecuador, investigates the roles of sex and gender in undernutrition among infants 6 to 9 months of age. Twenty-four-hour recall frequencies were used to assess dietary intake. Food outcome models were analyzed as prevalence ratios calculated using a binomial distribution with a log link or robust Poisson regression. Linear regression was used to analyze the continuous growth outcome length-for-age z score. Socioeconomic and health history variables were comparable between male and female infants. Boys were more often fed liquids other than breastmilk within their first 3 days of life (17.1% vs. 5.2%, P = 0.026). Compared with girls, boys were less likely to be fed eggs by 33% (95% CI 0.46, 0.96), cheese, yogurt, or other milk products by 40% (95% CI 0.39, 0.92), yellow fruit by 44% (95% CI 0.33, 0.97), water by 37% (95% CI 0.45, 0.88), thin porridge by 29% (95% CI 0.56, 0.92), and tea without milk by 67% (95% CI 0.11, 0.99). Prevalence of boys with an adequate dietary diversity score (≥ 4) was reduced by 27% relative to girls (95% CI 0.54, 0.99). Males fared worse in length-for-age z scores (− 2.16 vs. − 1.56, P = 0.000), weight-for-age z scores (− 0.86 vs. − 0.33, P = 0.002), prevalence of stunting (50.6% vs. 23.4%, P = 0.000), and plasma concentrations of dimethylglycine (1.25 vs. 1.65 µg/mL, P = 0.021). After adjusting for demographic, caregiver perceptions of appetite, and biological factors, length-for-age z score for a male child was 0.62 units lower than for a female (95% CI − 0.98, − 0.26). Male infants were shown to receive lower quality complementary foods and have worse anthropometric measures than female infants.Trial registration clinicaltrials.gov, NCT02446873. Registered February 28, 2015, https://clinicaltrials.gov/ct2/show/NCT02446873.