An investigation is made of the effects of the change of the porosity of the gas diffuser layer (GDL) on the performance of a proton exchange membrane (PEM) fuel cell. The analysis of fuel cell performance with non-uniform porosity of GDL is a necessity because the presence of liquid water in the GDL leads to a non-uniformly distributed porosity in the GDL. To implement this performance analysis, a half-cell model which considers the oxygen mass fraction distribution in the gas channel, the GDL and the catalyst layer, and the current density and the membrane phase potential in the catalyst layer and the membrane is investigated. Four continuous functions of position are employed to describe the porosity, and differential equations are derived based on oxygen transportation and Ohm's law for proton migration and solved numerically. Results show that a fuel cell embedded with a GDL with a larger averaged porosity will consume a greater amount of oxygen, so that a higher current density is generated and a better fuel cell performance is obtained. This explains partly why fuel cell performance deteriorates significantly as the cathode is flooded with water (i.e. to give a lower effective porosity in the GDL). In terms of the system performance, a change in GDL porosity has virtually no influence on the level of polarization when the current density is medium or lower, but exerts a significant influence when the current density is high. This finding supports the scenario proposed by previous studies that the polarization at high current density corresponds mainly to mass transfer through (or the concentration activation of) the membrane assembly.