In this work, non-invasive near-infrared spectroscopy (NIRS) combined with chemometrics was evaluated as a possible online analytical technique to categorize pieces of cured ham on the industrial production line based on their maximum sodium content. Stifle muscle was selected for the development of the NIRS prediction models because it is the one with the highest sodium content and the easiest in terms of accessibility for spectral measurement. In the study, samples with varying thicknesses were taken. The suitability of this method is demonstrated when a 5 mm sample is used for the construction of the model, obtaining the best fit with an R2cv of 92% and a prediction error of 0.11% sodium that coincides with the error of the reference method. In conclusion, a method is proposed for the direct determination of sodium content on the production line which allows the different pieces of ham to be quickly categorized according to their salt content.