Identification and assignments of metabolites is an important step in metabolomics and is necessary for the discovery of new biomarkers. In nuclear magnetic resonance (NMR) spectroscopy-based studies, the conventional approach involves a database search, wherein chemical shifts are assigned to specific metabolites by use of a tolerance limit. This is inefficient because deviation in chemical shifts associated with pH or temperature variations, as well as missing peaks, impairs a robust comparison with the database. We propose here a novel method based on matching the pattern of peaks rather than absolute tolerance thresholds, using a combination of geometric hashing and similarity scoring techniques. Tests with 719 metabolites from the Human Metabolome Database (HMDB) show that 100% of the metabolites can be assigned correctly when accurate data are available. A high success rate is obtained even in the presence of large chemical shift deviations such as 0.5 ppm in (1)H and 3 ppm in (13)C and missing peaks (up to 50%), compared to nearly no assignments obtained under these conditions with existing methods that employ a direct database search approach. The method was evaluated on experimental data on a mixture of 16 metabolites at eight different combinations of pH and temperature conditions. The pattern recognition approach thus helps in identification and assignment of metabolites independent of the pH, temperature, and ionic strength used, thereby obviating the need for spectral calibration with internal or external standards.