An image forming apparatus comprising: an image forming means configured to form a positional deviation correction pattern including developer images of a plurality of colors; a detection means configured to emit light to the positional deviation correction pattern formed by the image forming means and to detect reflected light from the positional deviation correction pattern; and a control means configured to perform positional deviation correction based on the detected result by the detection means, characterized in that the control means is configured to cause the image forming means to form the positional deviation correction pattern such that one black developer image is disposed between two color developer images of a same color, and in a case where a relative positional deviation occurs between the one black developer image and the two color developer images of the same color when the positional deviation correction pattern is formed, the control means is configured to cause the image forming means to form the positional deviation correction pattern such that either one of the two color developer images of the same color and the one black developer image are superposed on each other, a sweeping in the color developer images occurs at a downstream edge in a conveyance direction of a transfer medium on which the color developer images are formed, (fig. 6a, fig. 6b) a timing to detect the edge of the color developer images in the detected result obtained by the detection means is affected by a detection error due to the sweeping, and the control means is arranged to obtain a center position of the two color developer images of a same color and a center position of the one black developer image based on the detected result detected by the detection means, and to cancel the detection error by obtaining a positional deviation amount based on the center position of the two color developer images of the same color and a center position of the one black developer image. an image forming means configured to form a positional deviation correction pattern including developer images of a plurality of colors; a detection means configured to emit light to the positional deviation correction pattern formed by the image forming means and to detect reflected light from the positional deviation correction pattern; and a control means configured to perform positional deviation correction based on the detected result by the detection means, characterized in that the control means is configured to cause the image forming means to form the positional deviation correction pattern such that one black developer image is disposed between two color developer images of a same color, and in a case where a relative positional deviation occurs between the one black developer image and the two color developer images of the same color when the positional deviation correction pattern is formed, the control means is configured to cause the image forming means to form the positional deviation correction pattern such that either one of the two color developer images of the same color and the one black developer image are superposed on each other, a sweeping in the color developer images occurs at a downstream edge in a conveyance direction of a transfer medium on which the color developer images are formed, (fig. 6a, fig. 6b) a timing to detect the edge of the color developer images in the detected result obtained by the detection means is affected by a detection error due to the sweeping, and the control means is arranged to obtain a center position of the two color developer images of a same color and a center position of the one black developer image based on the detected result detected by the detection means, and to cancel the detection error by obtaining a positional deviation amount based on the center position of the two color developer images of the same color and a center position of the one black developer image.