With mass spectrometry the identification of unknown compounds is the main bottleneck. Tandem MS spectra measures fragment ions, but the coverage of spectral libraries of measured reference compounds are far from covering the complete chemical space. Compound libraries such as PubChem describe a larger number of compounds, which can be used to compare their in silico fragmentation with spectra of unknown metabolites. The developed software MetFrag obtains a candidate list from compound libraries based on the precursor mass, subsequently ranked by the agreement between measured and in silico fragments. Compared to a previously published study, MetFrag obtained better results than the MassFrontier 4. Especially for large compound libraries, the candidates with a good score show a high structural similarity, a subsequent clustering based on chemical distances reduces this redundancy and MassStruct allows the preordering of candidate compounds already in the database.