New research from Newcastle University in the UK suggests that there is a "fatherhood gene" that a man inherits from his parents.
In this way, a father who has many brothers is more likely to have a son, while a man with several sisters will boost his chances of having a little girl.
To reach their conclusions, scientists looked at more than 900 family trees that included data from 556,000 North Americans and Europeans over the past four centuries.
Lead author Dr Corry Gelatly told the BBC that over time the effect ends up evening out the mix of males and females in the population.
"If there there are too many males … females will more easily find a mate, so men who have more daughters will pass on more of their genes, causing more females to be born in later generations," he said.
The news may even lead some to wonder whether a man who is already used to having sisters may have an advantage in parenting skills if he fathers daughters – and vice versa.