Solid-phase microextraction (SPME) is a well-established technique in the analysis of food volatile compounds, usually performed for qualitative analysis. This paper presents an elaboration of conditions for SPME analysis of main volatile compounds in hard cheese and an evaluation of suitability of vacuum to improve the transfer of volatile compounds towards SPME fiber. Compounds representing the main groups of hard cheese volatiles were investigated: 1-pentanol, butanoic acid, 2,3-butanedione and 2-heptanone. Parameters for SPME extraction (temperature, water, sodium carbonate addition, time, vacuum) were evaluated. Application of vacuum had a positive effect on all analytes when extraction was performed from water, but in the cheese matrix the effect was significant only for butanoic acid. Extraction time was the most significant factor for extraction efficiency in examined cheeses, while temperature had a minor effect on the amount of extracted volatiles. The method was applied on Edam, Emmentaler, Gouda and Maasdam cheeses obtained from the market.