When an egg is fertilised, the embryo will have 23 pairs of chromosomes - but only one of these pairs is responsible for deciding whether or not you have a baby girl or a baby boy.
This pair of sex chromosomes is labelled as the X (female) and Y (male) chromosomes.
All eggs carry a single X chromosome, whereas sperm carry just one chromosome which could be either an X or a Y. It is therefore the father's sperm that determines whether or not you will have a girl or a boy.
When a sperm carrying the X chromosome fertilises an egg, it forms an XX pair of chromosomes. This means that you will have a girl.
But if a sperm carrying the Y chromosome fertilises the egg, this results in an XY set of chromosomes, and you've guessed it - you will have a boy!