We experimentally studied the dependence of high harmonic generation in argon and molecular hydrogen on pressure changes in a gas jet that cause variations of the phase matching conditions and absorption. The study was performed at a peak laser intensity of similar to 1.5 x 10(14) W/cm(2). To enable measurements over a wide range of pressures, we employed differential pumping with an additional cell (similar to 20 cm(3) volume) enclosing the gas jet. By increasing the pressure in the gas jet up to a maximum of 1.5 bars with argon or 0.5 bars with hydrogen, we observed an increase in the high harmonic (HH) yield until an optimum pressure of 0.2 bars was reached for Ar, beyond which the output began decreasing. For H-2, we observed an increase of the HH output up to the maximum pressure of 0.5 bars. This pressure-dependence study allowed us to achieve a tenfold enhancement in the high harmonic yield at the optimum pressure. (C) 2015 AIP Publishing LLC.