A simple theoretical model predicts that when a mother gives birth to a child of her preferred sex, parents will likely invest more resources in that child, leading to more significant human capital. This bias can result in unequal treatment and opportunities, affecting a child’s long-term development. This study investigates how gender preference influences cognitive ability between sons and daughters in Indonesia. This study utilizes longitudinal data from the Indonesian Family Life Survey 1 and 5, analyzed using the Ordinary Least Square method. The results indicate that daughters whose mothers had a son preference had 0.259 points higher cognitive scores. This finding is attributed to the sample distribution, revealing that daughters of mothers who prefer sons were mainly those without male siblings, allowing them to receive equal input from their parents without competing with boys. The heterogeneity analysis further revealed that daughters from disadvantaged backgrounds, such as those living in rural areas and born to less educated mothers, are disproportionately affected by son preference. In conclusion, it appears that children’s family background and sibling composition can significantly impact the disparity in cognitive achievement between sons and daughters.