The invention discloses automatic inverting device in automatic production line. It comprises inverting clamp, rocking arm, tray spanner end, rotary shaft drived cylinder, castellated shaft, inverting machine, rocking drived pushing cylinder which is set on one side of the castellated shaft through the beam, the spanner end slides along the castellated shaft, the free end of the spanner end is hole structure. The inverting clamp is on the pallet. The end of the inverting shaft is obtruding structure correspondent to the hole of the spanner end there sets bearing seat between castellated shaft and rocking oscillating arm. The invention is reliable and low cost.