Interfacial area is an important factor during two-phase flow in porous media because mass-transfer mechanisms take place at the interfaces of immiscible phases. The objective of this work is to quantify how grain-size distribution affects the temporal development of interfacial area during two-phase flow through porous media. A two-phase lattice Boltzmann model (color gradient method) was used to simulate drainage (displacement of a wetting fluid by a non-wetting fluid) and imbibition (displacement of the non-wetting fluid by the wetting fluid) in an ensemble of two-dimensional porous media samples. Five groups of porous media, each comprising 20 realizations, were characterized by their median grain size (d(50)) and coefficient of uniformity (C-u). For all 100 realizations, simulations of drainage and imbibition were conducted until steady-state saturation was achieved, and interfacial area was monitored throughout the simulations. During both drainage and imbibition, the interfacial area initially increases with time until reaching a peak area, then decreases, and then plateaus at a steady-state value. Interfacial area is higher during imbibition than during drainage. The temporal evolution of interfacial area, as quantified by peak area and time to reach peak area, was similar in the three groups characterized by small grain size (d(50) approximate to 7.7 lattice units) and relatively uniform grain-size distribution (C-u approximate to 1.21, 1.49, 1.85), for both drainage and imbibition. This suggests that, for the fluid conditions considered here, nonuniformity of grain size is not important below a certain threshold value of C-u. However, two groups with larger grain size (d(50) approximate to 8.9 lattice units) and relatively nonuniform grain-size distribution (C-u approximate to 1.85, 2.29) exhibited differences from each other, suggesting that nonuniformity of grain size affects interfacial area when C-u is above a certain value. Furthermore, median grain size was observed to have important effects on temporal evolution of interfacial area.