An image sensor comprising a plurality of image sensing pixel groups is provided. Each of the image sensing pixel groups has a plurality of first pixels each having photoelectric conversion portions arrayed in first and second directions for first and second numbers of divisions, respectively, and a plurality of second pixels each having photoelectric conversion portions arrayed in the first and second directions for third and fourth numbers of divisions, respectively. The photoelectric conversion portions comprising the first pixel and the second pixel have a function of photoelectrically converting a plurality of images formed by divided light fluxes of a light flux from an imaging optical system and outputting a focus detection signal for phase difference detection. The first and third numbers of division are coprime natural numbers, and the second and fourth numbers of divisions are coprime natural numbers.