A rapid and efficient technique using an electronic nose based on a mass detector combined with headspace sampling (HS-SPME-MS e-nose) and chemometric tools was applied to classify beer samples between fresh and aged and between samples contained in aluminium cans or glass bottles, and to predict the shelf life of beer. The mass spectra obtained from the HS-SPME-MS e-nose contain information on the volatile compounds, recorded as the abundance of each ion at different mass-to-charge (m/z) ratios. The analysis was performed on 53 samples aged naturally for eleven months in the absence of light and with a controlled temperature of around 14° C +/- 0.5° C. Principal Component Analysis (PCA) was performed on the data, showing a grouping of samples between fresh and aged. Partial Least Square Discriminant Analysis (PLS-DA) allowed discriminating fresh from aged beers but was not able to discriminate samples packaged in aluminium cans or in glass bottles. Finally, Partial Least Square Regression (PLSR) was applied to build a prediction model and showed to be effective to predict beer shelf life.