# Gender Code

Key: `identity.person.gender_code`

Single-character sex/gender code. ICAO Doc 9303 passport sex field uses M (male), F (female), X (unspecified). ISO/IEC 5218 numeric coding uses 0 (not known), 1 (male), 2 (female), 9 (not applicable). Matched case-insensitively (ac-02).

Page: <https://meridian.online/docs/projects/finetype/types/identity/person/gender_code>

Samples: `M`, `F`, `X`, `1`

## Background

### Origin

ISO/IEC 5218, Information technology — Codes for the representation of human sexes, is an international standard that represents human sexes with a language-neutral single-digit code.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218) Its four codes are 0 for not known, 1 for male, 2 for female and 9 for not applicable.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218) The standard was proposed in November 1976 and updated in June 2022.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218) It is maintained by the ISO/IEC JTC 1 subcommittee on data management and interchange, ISO/IEC JTC 1/SC 32.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218) The standard states that no significance is to be placed on male being coded 1 and female 2, which merely reflects existing practice in the countries that initiated it.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218) Since its 2022 revision, the standard states that its scope does not cover human gender identities.[[1]](https://en.wikipedia.org/wiki/ISO/IEC_5218)

### Use

The TEI Guidelines for encoding texts define a data.sex datatype whose values are 0, 1, 2 and 9.[[2]](https://tei-c.org/Vault/P5/1.6.0/doc/tei-p5-doc/en/html/ref-data.sex.html) TEI states that those values are taken from ISO 5218:2004.[[2]](https://tei-c.org/Vault/P5/1.6.0/doc/tei-p5-doc/en/html/ref-data.sex.html)

Keep 0 and 9 apart when you clean the column: not known and not applicable answer different questions, and folding both into a null loses that. (Meridian's view)

### Where you'll meet it

Insee's Fichier des personnes décédées, published on data.gouv.fr, stores sex as a one-character numeric field at position 81 of each record.[[3]](https://www.data.gouv.fr/datasets/fichier-des-personnes-decedees) In that file, 1 means male and 2 means female.[[3]](https://www.data.gouv.fr/datasets/fichier-des-personnes-decedees)

## Sources

1. [ISO/IEC 5218 - Wikipedia](https://en.wikipedia.org/wiki/ISO/IEC_5218) — secondary source
2. [TEI macro data.sex](https://tei-c.org/Vault/P5/1.6.0/doc/tei-p5-doc/en/html/ref-data.sex.html) — documentation
3. [Fichier des personnes décédées](https://www.data.gouv.fr/datasets/fichier-des-personnes-decedees) — dataset
