This paper investigates the viability and stability of anisotropic compact stars in the framework of f(R,T2) theory (R is the Ricci scalar and T2=TτυTτυ). In this perspective, we use Finch–Skea symmetry and consider different f(R,T2) models to examine physical characteristics of compact stars. We match interior spacetime with the exterior region to find the values of unknown constants. Further, we analyze the behavior of several physical quantities such as effective matter variables, energy bounds, anisotropic factor and equation of state parameters in the interior of Vela X-1, SAX J 1808.4-3658, Her X-1 and PSR J0348+0432 stars. The equilibrium state of these compact stars is examined through the Tolman–Oppenheimer–Volkoff equation and their stability is checked by causality condition, Herrera cracking approach and adiabatic index. It is found that all the required conditions are fulfilled for the considered models. We can conclude that more viable and stable compact stars are obtained in this modified theory.