an image forming apparatus includes : an image forming apparatus main body including an image forming unit that forms an image on a sheet , a detachable main body sheet feeding tray that holds the sheet and a sheet feeding unit that feeds the sheet from the main body sheet feeding tray toward the image forming unit ; an optional sheet feeding device that is capable of being added on a lower side of the main body sheet feeding tray and feeds the sheet toward the image forming unit , the optional sheet feeding device having a first detector that detects whether or not the main body sheet feeding tray is attached to a proper position ; and a controller that controls operations of the image forming apparatus main body and the optional sheet feeding device based on a detection result of the first detector .