A hemoglobin sensor capable of quickly detecting occult blood of excreta in a toilet and a detecting method thereof are disclosed. The hemoglobin sensor includes a handheld housing and a result presentation unit. The housing includes a light emitting unit, an operating interface, a light sensing unit, and a data processor disposed therein. The operating interface is connected to the light emitting unit for activating the light emitting unit to emit a plurality of incident light beams having wavelengths in a range between 350 nm and 800 nm. The incident light beams penetrate a solution in a container having excreta and hit a light reflector of the container to produce at least one detection light beam. The light sensing unit receives the detection light beam and output a detection signal, and the data processor generates a detection result data after receiving the detection signal and analyzing it. The result presentation unit receives the detection result data and shows whether occult blood is present in the excreta.