In this study, we propose a general way of finding a new crystal structure starting from a database. We also introduce a concise representation of the data based on principal invariants derived from the spatial arrangement of atoms in the crystal structure. Since the selection of the present representation does not depend on the size and selection method of the unit-cell defining the crystal structure, it is ideal for measuring similarity between two arbitrarily different crystal structures. For a more general search for crystal structures, the known crystal structure space is better defined using a variational autoencoder. Furthermore, we used either Pearson's correlation or the square root of the Jensen-Shannon divergence to directly search similar crystal structures for a wide variety of space groups. Our novel method uses extended database information, the similarity measure, and first-principles electronic structure calculation to predict several new metastable crystal structures of SnSe, P, and SnS.