Current regulations on civil status are discriminatory against intersex people, the Federal Constitutional Court said.
Legislators must by the end of 2018 pass a new regulation to offer a third gender option in birth registers, added the court, ruling in favour of an appeal brought by an intersex person.
The plaintiff had brought the appeal after several lower courts had ruled against a bid for gender change to "inter" or "various" in the birth register.
Intersex is a broad term encompassing people who have sex traits, such as genitals or chromosomes, that do not entirely fit with typical binary notion of male and female.
So intersex people would have features that are neither wholly female nor wholly male, or a combination or neither.
People who identify as intersex are recognised on official documents in some countries including Australia, India, New Zealand and Nepal.