An image forming apparatus includes a housing including a cover configured
to cover an opening provided in the housing, a transfer unit configured
to move a loop-shaped moving member, a portion of which, across an entire
width in a direction perpendicular to a moving direction thereof, being
exposed through the opening when the cover is opened, and a sensor unit
including a holding member configured to hold a plurality of optical
sensors arranged in a direction perpendicular to the moving direction of
the loop-shaped moving member and configured to detect detecting
respective amounts of light at respective areas different from each other
on the loop-shaped moving member, end portions of the sensor unit being
fixed in the housing at end portions of the opening in a widthwise
direction perpendicular to the moving direction of the loop-shaped moving
member.