Sex and gender are often used interchangeably; however, this is not accurate. They’re two distinct concepts.
Sex refers to sex characteristics. Sex recorded at birth refers to the sex characteristics observed at birth or infancy.
Gender is a social and cultural concept. It is about social and cultural differences in identity, expression and experience as a man, woman, or non-binary person. Non-binary is an overarching term describing gender identities that are not exclusively male or female.