How to legally change your gender in the UK

Some trans+ people find it validating to have their gender on documents match their identity. Here’s how to do this legally in the UK.