The World Health Organization (WHO) declared in a May 2023 announcement that the COVID-19 illness is no longer categorized as a Public Health Emergency of International Concern (PHEIC); nevertheless, it is still considered an actual threat to world health, social welfare and economic stability. Consequently, the development of a convenient, reliable and affordable approach for detecting and identifying SARS-CoV-2 and its emerging new variants is crucial. The fingerprint and signal amplification characteristics of surface-enhanced Raman spectroscopy (SERS) could serve as an assay scheme for SARS-CoV-2. Here, we report a machine learning-based label-free SERS technique for the rapid and accurate detection and identification of SARS-CoV-2. The SERS spectra collected from samples of four types of coronaviruses on gold nanoparticles film, fabricated using a Langmuir–Blodgett self-assembly, can provide more spectroscopic signatures of the viruses and exhibit low limits of detection (<100 TCID50/mL or even <10 TCID50/mL). Furthermore, the key Raman bands of the SERS spectra were systematically captured by principal component analysis (PCA), which effectively distinguished SARS-CoV-2 and its variant from other coronaviruses. These results demonstrate that the combined use of SERS technology and PCA analysis has great potential for the rapid analysis and discrimination of multiple viruses and even newly emerging viruses without the need for a virus-specific probe.