The invention relates to a device for optically identifying the sex of a slaughter pig with a depth camera that has a depth camera acquisition region in which a genital region of the pig and spatial coordinates of pixels are acquired. The spatial coordinates are provided in a transmittable manner and include a positioning device to position the depth camera relative to the genital region of the pig. The device includes an evaluation unit connected to the depth camera. The spatial coordinates are acquired by the evaluation unit to determine a phenotypic sex of the pig.