In 1867, Sylvester considered n × n matrices, (aij), with nonzero complex-valued entries, which satisfy (aij)(aij−1) = nI Such a matrix he called inverse orthogonal. If an inverse orthogonal matrix has all entries on the unit circle, it is a unit Hadamard matrix, and we have orthogonality in the usual sense. Any two inverse orthogonal (respectively, unit Hadamard) matrices are equivalent if one can be transformed into the other by a series of operations involving permutation of the rows and columns and multiplication of all the entries in any given row or column by a complex number (respectively a number on the unit circle). He stated without proof that there is exactly one equivalence class of inverse orthogonal matrices (and hence also of unit Hadamard matrices) in prime orders and that in general the number of equivalence classes is equal to the number of distinct factorisations of the order. In 1893 Hadamard showed this assertion to be false in the case of unit Hadamard matrices of non-prime order. We give the correct number of equivalence classes for each non-prime order, and orders ≤ 3, giving a complete, irredundant set of class representatives in each order ≤ 4 for both types of matrices.