An image forming apparatus having an image forming unit for forming toner
images on an image carrier, a transfer unit for transferring an image on
an image carrier onto a transfer medium, a detecting unit for detecting a
toner image for detection on the image carrier, and a cleaning unit
having a cleaning member that comes in and out of contact with the
surface of the image carrier, wherein the cleaning unit is disposed
downstream of the detecting unit and upstream of the transfer unit in the
traveling direction of the image carrier, and the cleaning member is
brought in contact with the image carrier when removing a toner image for
detection on the image carrier.