A photoelectric sensor , comprising a light projecting part that emits light, a light receiving part that receives light, a housing that houses the light projecting part and the light receiving part and an indicator that displays a detection result of an object being detected, wherein the housing comprises: a first surface having a light projecting/receiving surface allowing light from the light projecting part and light to the light receiving part to pass; a second surface being parallel to the first surface and located on a side opposite to the first surface ; a third surface extending in a direction orthogonal to the first surface and the second surface ; and an inclined surface inclined with respect to the third surface and the second surface , characterized in that the photoelectric sensor further comprises a button serving as a setting part that receives an input operation from outside to set a threshold value, an adjustment button 20 functioning as an adjustment part that receives an input operation from outside to finely adjust the threshold value that has been set, and a sealing member attached to the housing for sealing a periphery of the indicator and the button serving as a setting part, the third surface is adjacent to the first surface , the inclined surface connects the third surface and the second surface , the button serving as a setting part and the indicator are provided on the third surface in order from the side of the inclined surface , the adjustment button functioning as an adjustment part is provided on the inclined surface , a distance (L1) between the button serving as a setting part and the adjustment button functioning as an adjustment part is larger than a distance (L2) between the button serving as a setting part and the indicator , the periphery of the indicator and the button serving as a setting part are collectively sealed by the sealing member , and the third surface and/or the inclined surface has a part of an area sealed by the sealing member between the button serving as a setting part and the adjustment button functioning as an adjustment part . a first surface having a light projecting/receiving surface allowing light from the light projecting part and light to the light receiving part to pass; a second surface being parallel to the first surface and located on a side opposite to the first surface ; a third surface extending in a direction orthogonal to the first surface and the second surface ; and an inclined surface inclined with respect to the third surface and the second surface , characterized in that the photoelectric sensor further comprises a button serving as a setting part that receives an input operation from outside to set a threshold value, an adjustment button 20 functioning as an adjustment part that receives an input operation from outside to finely adjust the threshold value that has been set, and a sealing member attached to the housing for sealing a periphery of the indicator and the button serving as a setting part, the third surface is adjacent to the first surface , the inclined surface connects the third surface and the second surface , the button serving as a setting part and the indicator are provided on the third surface in order from the side of the inclined surface , the adjustment button functioning as an adjustment part is provided on the inclined surface , a distance (L1) between the button serving as a setting part and the adjustment button functioning as an adjustment part is larger than a distance (L2) between the button serving as a setting part and the indicator , the periphery of the indicator and the button serving as a setting part are collectively sealed by the sealing member , and the third surface and/or the inclined surface has a part of an area sealed by the sealing member between the button serving as a setting part and the adjustment button functioning as an adjustment part . <EOS>