An optical sorter comprising: a light source configured to emit light toward a granular sorting target in transit; a color sensor including an R element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to red, a G element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to green, and a B element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to blue, the color sensor being configured to detect light associated with the sorting target in transit, at least two element groups out of the R element group, the G element group, and the B element group being arranged so as to be spaced apart from each other in a transit direction of the sorting target; and a determination part configured to determine a foreign object and/or a defective product with respect to the sorting target based on a signal acquired by the color sensor, characterized by: a color shift amount calculation part configured to calculate, based on a color image acquired by the color sensor, an amount of a color shift that occurs due to the fact that the at least two element groups are spaced apart from each other in the transit direction of the sorting target; a speed calculation part configured to calculate a transit speed of the sorting target based on a separation distance between the at least two element groups in the transit direction, the color shift amount, and a scan time, which is a time required for the color sensor to scan the sorting target once; and a sorting device configured to perform a trajectory change operation for changing a trajectory of a specific sorting target determined based on a result of the determination by the determination part at a timing determined based on the transit speed calculated by the speed calculation part. a light source configured to emit light toward a granular sorting target in transit; a color sensor including an R element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to red, a G element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to green, and a B element group, which is a plurality of optical elements for detecting light having a wavelength corresponding to blue, the color sensor being configured to detect light associated with the sorting target in transit, at least two element groups out of the R element group, the G element group, and the B element group being arranged so as to be spaced apart from each other in a transit direction of the sorting target; and a determination part configured to determine a foreign object and/or a defective product with respect to the sorting target based on a signal acquired by the color sensor, characterized by: a color shift amount calculation part configured to calculate, based on a color image acquired by the color sensor, an amount of a color shift that occurs due to the fact that the at least two element groups are spaced apart from each other in the transit direction of the sorting target; a speed calculation part configured to calculate a transit speed of the sorting target based on a separation distance between the at least two element groups in the transit direction, the color shift amount, and a scan time, which is a time required for the color sensor to scan the sorting target once; and a sorting device configured to perform a trajectory change operation for changing a trajectory of a specific sorting target determined based on a result of the determination by the determination part at a timing determined based on the transit speed calculated by the speed calculation part. a color shift amount calculation part configured to calculate, based on a color image acquired by the color sensor, an amount of a color shift that occurs due to the fact that the at least two element groups are spaced apart from each other in the transit direction of the sorting target; a speed calculation part configured to calculate a transit speed of the sorting target based on a separation distance between the at least two element groups in the transit direction, the color shift amount, and a scan time, which is a time required for the color sensor to scan the sorting target once; and a sorting device configured to perform a trajectory change operation for changing a trajectory of a specific sorting target determined based on a result of the determination by the determination part at a timing determined based on the transit speed calculated by the speed calculation part.