The electrospray ionisation mass spectrum (ESI-MS) of 2,4-bis[4-(N-methyl-N-butylamino)phenyl]squaraine shows peaks which correspond to the fragmentation pattern of the dimeric aggregate (e.g. m/z=810 [2M + 2H](+)) and, although the molecule is centrosymmetric, solid solutions of the dye exhibit second-harmonic generation (SHG). In order to satisfy the structural requirement the nonlinear optical behaviour is attributed to the dimeric aggregate which must be non-centrosymmetric. In contrast, solid solutions of the tetrahydroxy analogue, 2,4-bis [4-(N-methyl-N-butylamino)-2,6-dihydroxyphenyl]squaraine, are SHG-inactive and the ESI-MS data are consistent with the formation of a heptameric aggregate (m/z=819 [1.75M](+)=[7M](4+)). The aggregation number is compound specific and an extensive study of fourteen anilino squaraines has shown direct correlation between the type of aggregate and the occurrence or absence of SHG.