An optical sensor includes a substrate, light emitting units for emitting light with different wavelengths, and a photodetector. The substrate has at least one receiver for containing these light emitting units and a slot for containing the photodetector. A light guide structure of the optical sensor can be the receiver with a specific design, so that the light emitted by the light emitting units can be reflected towards a central axis of the photodetector. Thus, when at least one of the light emitting units emits light onto an object, the photodetector can receive the light reflected from the object.