Provided is a magnetic encoder device capable of detecting a rotating angle of an actuator having a cavity structure.