1. An image forming apparatus comprising: an image bearer whose surface moves; a toner image forming unit that forms a toner image on the surface of the image bearer by using a developer; a transfer unit that transfers the toner image formed on the surface of the image bearer onto a surface of a transfer member by applying a transfer bias thereto; a detector that detects an image density of the toner image formed on the surface of the transfer member; and a controller that controls the transfer bias, wherein the toner image forming unit forms a plurality of types of density detection patterns on the surface of the image bearer in mutually-different positions in a surface-movement direction of the image bearer, the plurality of types of density detection patterns having mutually-different lengths in a direction orthogonal to the surface-movement direction of the image bearer, the transfer unit transfers the plurality of types of density detection patterns onto the surface of the transfer member without varying the transfer current, the detector detects image densities of the plurality of types of density detection patterns transferred on the surface of the transfer member, and the controller calculates an image density difference between the plurality of types of density detection patterns on a basis of a detection result obtained by the detector, and corrects the transfer bias on a basis of a value of the image density difference.