A non-Noether conserved quantity, i.e. Hojman conserved quantity，constructed by using a form invariance for the nonholonomic mechanical systems is presented. Under special infinitesimal transformations in which the time is not changed, the determining equations of the special form invariance, the constrained restriction equations, the additional restriction equations, and the definitions of the weak form invariance and the strong form invariance of the nonholonomic mechanical systems are given. The condition under which the special form invariance is a special Lie symmetry are obtained. From the special form invariance, the Hojman conserved quantity of the corresponding holonomic systems, the weak Hojman conserved quantity and the strong Hojman conserved quantity of the nonholonomic systems are obtained. And two examples are given to illustrate the application of the result.