In this work we synthesized BaTaON and SrTaON using a two-step high-temperature solid-state reaction method and analysed the structural distortions, relative to the ideal cubic perovskite structure, according to group theory. From a complete distortion analysis/refinement using high-resolution neutron diffraction data in the temperature range 8 to 613 K, we identified tetragonal structures for BaTaON [P4/mmm (No. 123)] and SrTaON [I4/mcm (No. 140)]. In contrast to an anion-disordered cubic perovskite (Pm \overline{3}m No. 221) with Ta at the cell center, both systems show a site preference for oxygen anions in the two opposite corners (along the c axis) of the Ta-O/N octahedra rather than the four square corners in the ab plane (Γ occupancy distortion), which induces a tetragonal elongation of the unit cell with the c axis being longer than the a axis. A further Ta-O/N octahedra displacement [R(a,0,0), rotation about the c axis] distortion was observed in SrTaON. This distortion mode is accompanied by an increased unit-cell distortion that decreases as the temperature increases. Ultimately a second-order phase transition caused by the loss of the R(a,0,0) mode was observed at 400-450 K.