signature
The signature of a real symmetric form is the triple (p, q, z): p is the number of positive squares, q the number of negative squares, and z the number of zero coefficients when you diagonalize it. Sylvester's law of inertia guarantees these counts do not depend on how you diagonalized, so the triple is a genuine attribute of the form, not of any particular basis.
These three numbers are the COMPLETE invariant for real symmetric forms: two real symmetric matrices are congruent if and only if they have the same signature. So over the reals, classifying quadratic forms up to congruence is finished — just read off (p, q, z). The rank is p + q (the number of nonzero squares) and z = n - rank, so really two of the three numbers are free.
Many sources report the signature as a single number p - q, the surplus of positives over negatives, especially when the form is nondegenerate (z = 0) so that p and q alone determine everything. Both conventions are common; always check which one a text means. In physics the metric signature (+,-,-,-) of spacetime is exactly this idea, with p = 1 and q = 3.
Where signature comes from is worth a sentence: it equals the count of positive, negative, and zero EIGENVALUES of the symmetric matrix B. Congruence scrambles the actual eigenvalues but cannot change their signs, so eigenvalue signs and the signature are the same data. That bridge — eigenvalues you can compute, signature you can interpret — is why the principal axis theorem matters.
Two positive and one negative square: a nondegenerate form of signature (2,1,0).
Two real symmetric matrices are congruent iff their signatures match — the cleanest complete-invariant statement in this whole field. Always note whether a book writes signature as (p,q,z) or as p - q.