1. An image forming apparatus comprising: an image carrier being stretched around a plurality of rolls; and a detection unit that detects a density of a toner image formed on the image carrier, based on an amount of regularly reflected light from a surface of the image carrier, wherein a detection length where the detection unit performs the detection in a movement direction of the image carrier is longer than a length, in the movement direction of the image carrier, of a deformation area where a deformation of the image carrier is caused.