A solid-state image sensor comprising: a ranging pixel (100, 150, 200, 300) including a pupil dividing unit, a plurality of photoelectric conversion units (121, 122, 171, 172, 173, 174) and a barrier area between two adjacent photoelectric conversion units, wherein a width of the barrier area is a distance between two adjacent photoelectric conversion units, wherein the pupil dividing unit is configured to divide incident light that has passed through an exit pupil of an imaging optical system; the photoelectric conversion units are configured to receive the incident light that has passed though the pupil dividing unit; the ranging pixel includes an optical isolation layer between the pupil dividing unit and the plurality of photoelectric conversion units, wherein the optical isolation layer includes a plurality of high-refractive-index areas (111, 112, 161, 162, 163, 164, 311, 312) and a low-refractive-index area (113, 165, 313) having a lower refractive index than the refractive index of the high-refractive-index areas, the high-refractive-index areas being disposed above the plurality of photoelectric conversion units, and the low-refractive-index area being disposed between the plurality of the high-refractive-index areas; the refractive index changes stepwise at the boundaries between the high-refractive-index areas and the low-refractive-index area; the refractive index difference of the stepwise changing portion is 0.15 or more; a value obtained by multiplying the physical thickness of the optical isolation layer by the refractive index of the high-refractive-index areas is 2.0 or less times as large as the wavelength of incident light; characterized in that the high-refractive-index areas are enclosed by and in direct contact with the low-refractive-index area and a low refractive index medium having a lower refractive index than the refractive index of the high-refractive-index areas disposed closer to the pupil dividing unit than the high-refractive-index areas, such that the incident light that is directed to the low-refractive index area is refracted to the high-refractive index areas so as not to enter the barrier area; and the high-refractive-index areas are disposed only above the plurality of photoelectric conversion units. a ranging pixel (100, 150, 200, 300) including a pupil dividing unit, a plurality of photoelectric conversion units (121, 122, 171, 172, 173, 174) and a barrier area between two adjacent photoelectric conversion units, wherein a width of the barrier area is a distance between two adjacent photoelectric conversion units, wherein the pupil dividing unit is configured to divide incident light that has passed through an exit pupil of an imaging optical system; the photoelectric conversion units are configured to receive the incident light that has passed though the pupil dividing unit; the ranging pixel includes an optical isolation layer between the pupil dividing unit and the plurality of photoelectric conversion units, wherein the optical isolation layer includes a plurality of high-refractive-index areas (111, 112, 161, 162, 163, 164, 311, 312) and a low-refractive-index area (113, 165, 313) having a lower refractive index than the refractive index of the high-refractive-index areas, the high-refractive-index areas being disposed above the plurality of photoelectric conversion units, and the low-refractive-index area being disposed between the plurality of the high-refractive-index areas; the refractive index changes stepwise at the boundaries between the high-refractive-index areas and the low-refractive-index area; the refractive index difference of the stepwise changing portion is 0.15 or more; a value obtained by multiplying the physical thickness of the optical isolation layer by the refractive index of the high-refractive-index areas is 2.0 or less times as large as the wavelength of incident light; characterized in that the high-refractive-index areas are enclosed by and in direct contact with the low-refractive-index area and a low refractive index medium having a lower refractive index than the refractive index of the high-refractive-index areas disposed closer to the pupil dividing unit than the high-refractive-index areas, such that the incident light that is directed to the low-refractive index area is refracted to the high-refractive index areas so as not to enter the barrier area; and the high-refractive-index areas are disposed only above the plurality of photoelectric conversion units.