A linear rotary mechanism (10) comprising:a pair of elongated guide rails (21) in parallel to each other, a linear motor (30) and a rotary motor (40);characterized in thatthe linear motor (30) having a tubular primary side (31) slidably disposed on the guide rails (21) and a shaft-shaped secondary side (32) coaxially extending into an internal hole of the tubular primary side (31), the shaft-shaped secondary side (32) being axially linearly reciprocally movable along the tubular primary side (31); andthe rotary motor (40) fixedly disposed on the guide rails (21) and connected with one end of the shaft-shaped secondary side (32), the rotary motor (40) being linearly reciprocally movable along the tubular primary side (31) in synchronism with the shaft-shaped secondary side (32) and the guide rails (21).