Soil-available nitrogen is the main nitrogen source that plants can directly absorb for assimilation. It is of great significance to detect the concentration of soil-available nitrogen in a simple, rapid and reliable method, which is beneficial to guiding agricultural production activities. This study confirmed that Raman spectroscopy is one such approach, especially after surface enhancement; its spectral response is more sensitive. Here, we collected three types of soils (chernozem, loess and laterite) and purchased two kinds of nitrogen fertilizers (ammonium sulfate and sodium nitrate) to determine ammonium nitrogen (NH4-N) and nitrate nitrogen (NO3-N) in the soil. The spectral data were acquired using a portable Raman spectrometer. Unique Raman characteristic peaks of NH4-N and NO3-N in different soils were found at 978 cm−1 and 1044 cm−1, respectively. Meanwhile, it was found that the enhancement of the Raman spectra by silver nanoparticles (AgNPs) was greater than that of gold nanoparticles (AuNPs). Combined with soil characteristics and nitrogen concentrations, Raman peak data were analyzed by multiple linear regression. The coefficient of determination for the validation () of multiple linear regression prediction models for NH4-N and NO3-N were 0.976 and 0.937, respectively, which deeply interpreted the quantitative relationship among related physical quantities. Furthermore, all spectral data in the range of 400–2000 cm−1 were used to establish the partial least squares (PLS), back-propagation neural network (BPNN) and least squares support vector machine (LSSVM) models for quantification. After cross-validation and comparative analysis, the results showed that LSSVM optimized by particle swarm methodology had the highest accuracy and stability from an overall perspective. For all datasets of particle swarm optimization LSSVM (PSO-LSSVM), the was above 0.99, the root mean square errors of prediction (RMSEP) were below 0.15, and the relative prediction deviation (RPD) was above 10. The ultra-portable Raman spectrometer, in combination with scatter-enhanced materials and machine learning algorithms, could be a promising solution for high-efficiency and real-time field detection of soil-available nitrogen.