In this paper, we study the form invariance of a mechanical system with unilateral holonomic constraints. According to the invariance of the form of the differential equation of motion under the infinitesimal transformations, we give the definition and criterion for the form invariance of mechanical systems with unilateral holonomic constraints, and establish the relation between the form invariance and Noether symmetry and Lie symmetry. In the end of the paper, an example is given to illustrate the application of the results.