Abstract.Consider the algebra Mn(F) of n × n matrices over an infinite field F of arbitrary characteristic. An identity for Mn(F) with forms is such a polynomial in n×n generic matrices and in σ k (x), 1 ≤ k ≤ n, coefficients in the characteristic polynomial of monomials in generic matrices, that is equal to zero matrix. This notion is a characteristic free analogue of identities for Mn(F) with trace and it can be applied to the problem of investigation of identities for Mn(F). In 1996 Zubkov established an infinite generating set for the T-ideal Tn of identities for Mn(F) with forms. Namely, for t > n he introduced partial linearizations of σt and proved that they together with the well-known free relations and the Cayley-Hamilton polynomial χn generate Tn as a T-ideal. We show that it is enough to take partial linearizations of σt for n < t ≤ 2n. In particular, the T-ideal Tn is finitely based.Working over a field of characteristic different from two, we obtain a similar result for the ideal T ′ n of identities with forms for the F-algebra generated by n × n generic and transpose generic matrices. It follows from our previous papers that the T-ideal T ′ n is generated by partial linearizations of σt,r for t + 2r > n, the well-known free relations, χt,r for t + 2r = n, and ζt,r for t + 2r = n − 1, where σt,r is the identity introduced by Zubkov in 2005 and χt,r, ζt,r are generalizations of the Cayley-Hamilton polynomial. We prove that it is enough to take partial linearizations of σt,r for n < t + 2r ≤ 2n. In particular, the T-ideal T ′ n is finitely based.These results imply that ideals of identities for the algebras of matrix GL(n)-and O(n)-invariants are generated by the well-known free relations together with partial linearizations of σt for n < t ≤ 2n and partial linearizations of σt,r for n < t + 2r ≤ 2n, respectively.