Sex refers to the aspects of a person's biology which are sexually dimorphic. This includes chromosomes, hormone levels, genitalia, gametes, and secondary sex characteristics such as breast size, hip to waist ratio, body hair, and voice pitch. These characteristics are sometimes viewed as being a person's gender; however, sex and gender are generally considered separate concepts.
Although each person's sex characteristics are slightly different, sex is often grouped broadly into two categories: male and female, referred to as binary or dyadic sexes. Sex is typically assigned at birth based on external physiology and may not reflect how a person prefers to be characterized as later in life. People whose sex cannot be categorized clearly as male or female are referred to as intersex and many are given "corrective" surgery without their consent so that their biology more closely matches male or female.
Unlike gender expression, sex characteristics can typically only be altered through medical treatment, such as surgery or hormone replacement therapy. Transgender people often undergo such treatments as part of their transition. Cisgender people may also alter their sex characteristics through medical treatments, such as by taking hormone replacement therapy (e.g. to relieve symptoms of menopause or low T) or undergoing a mastectomy (e.g. to treat breast cancer). Sex characteristics which do not align with gender identity can result in dysphoria.
Referring to transgender people via their sex is typically seen as disrespectful, as people prefer to be called by their gender. In cases where gender is considered irrelevant, such as certain medical settings, it is sometimes more important to consider a person's individual biology and history than which broad categorization they fall under.