An optical sensor comprising: a substrate; at least three light emitting elements (3, 4, 5) mounted on a surface of the substrate; a light emission controller configured to control light emission operations of the at least three light emitting elements; and at least one light receiving element located within a region of a triangle connecting the at least three light emitting elements and mounted on the surface of the substrate, wherein the light receiving element is configured to receive light obtained by reflecting, by a detection object (Obj), light emitted from the light emitting elements, the light emitting elements are configured to emit light toward outside the triangular region connecting the light emitting elements, when an X axis and a Y axis parallel to the surface of the substrate and perpendicular to each other are virtually set with respect to the at least three light emitting elements, at least either one of length and breadth dimensions of a rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around a projection triangle formed when intersections of a virtually set XY plane (Sxy) and optical axes (V1, V2, V3) of light beams emitted from the at least three light emitting elements are perpendicularly projected on the surface of the substrate is larger than a corresponding one of length and breadth dimensions of a rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around the triangle connecting the at least three light emitting elements, and the optical sensor being characterised in that: the triangle connecting the at least three light emitting elements (3, 4, 5) is an isosceles triangle, a ratio between a base and a height of the isosceles triangle being 1: 1, and the length and breadth dimensions of the rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around the projection triangle formed when the intersections of the virtually set XY plane (Sxy) and the optical axes of the light beams emitted from the at least three light emitting elements are perpendicularly projected on the surface of the substrate are substantially the same. a substrate; at least three light emitting elements (3, 4, 5) mounted on a surface of the substrate; a light emission controller configured to control light emission operations of the at least three light emitting elements; and at least one light receiving element located within a region of a triangle connecting the at least three light emitting elements and mounted on the surface of the substrate, wherein the light receiving element is configured to receive light obtained by reflecting, by a detection object (Obj), light emitted from the light emitting elements, the light emitting elements are configured to emit light toward outside the triangular region connecting the light emitting elements, when an X axis and a Y axis parallel to the surface of the substrate and perpendicular to each other are virtually set with respect to the at least three light emitting elements, at least either one of length and breadth dimensions of a rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around a projection triangle formed when intersections of a virtually set XY plane (Sxy) and optical axes (V1, V2, V3) of light beams emitted from the at least three light emitting elements are perpendicularly projected on the surface of the substrate is larger than a corresponding one of length and breadth dimensions of a rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around the triangle connecting the at least three light emitting elements, and the optical sensor being characterised in that: the triangle connecting the at least three light emitting elements (3, 4, 5) is an isosceles triangle, a ratio between a base and a height of the isosceles triangle being 1: 1, and the length and breadth dimensions of the rectangle that has sides substantially parallel to the X axis and the Y axis and is circumscribed around the projection triangle formed when the intersections of the virtually set XY plane (Sxy) and the optical axes of the light beams emitted from the at least three light emitting elements are perpendicularly projected on the surface of the substrate are substantially the same.