The diversity of experimental workflows involving LC-MS/MS and the extended range of mass spectrometers tend to produce extremely variable spectra. Variability reduces the accuracy of compound identification produced by commonly available software for a spectral library search. We introduce here a new algorithm that successfully matches MS/MS spectra generated by a range of instruments, acquired under different conditions. Our algorithm called X-Rank first sorts peak intensities of a spectrum and second establishes a correlation between two sorted spectra. X-Rank then computes the probability that a rank from an experimental spectrum matches a rank from a reference library spectrum. In a training step, characteristic parameter values are generated for a given data set. We compared the efficiency of the X-Rank algorithm with the dot-product algorithm implemented by MS Search from the National Institute of Standards and Technology (NIST) on two test sets produced with different instruments. Overall the X-Rank algorithm accurately discriminates correct from wrong matches and detects more correct substances than the MS Search. Furthermore, X-Rank could correctly identify and top rank eight chemical compounds in a commercially available test mix. This confirms the ability of the algorithm to perform both a straight single-platform identification and a cross-platform library search in comparison to other tools. It also opens the possibility for efficient general unknown screening (GUS) against large compound libraries.