For sexing silkworm cocoons, a delivery mechanism carries a checker cocooning frame holding silkworm cocoons. A detection mechanism detects a female silkworm cocoon based on an optical wavelength emitted by the female silkworm cocoon. A sorting mechanism sorts the silkworm cocoons, putting female silkworm cocoons into a female collecting box, and male silkworm cocoons into a male collecting box