Energy harvesters for mechanical vibrations are electro-mechanical systems designed to capture ambient dispersed kinetic energy, and to convert it into usable electrical power. The random nature of mechanical vibrations, combined with the intrinsic non-linearity of the harvester, implies that long, time domain Monte-Carlo simulations are required to assess the device performance, making the analysis burdensome when a large parameter space must be explored. Therefore a simplified, albeit approximate, semi-analytical analysis technique is of paramount importance. In this work we present a methodology for the analysis and design of nonlinear piezoelectric energy harvesters for random mechanical vibrations. The methodology is based on the combined application of model order reduction, to project the dynamics onto a lower dimensional space, and of stochastic averaging, to calculate the stationary probability density function of the reduced variables. The probability distribution is used to calculate expectations of the most relevant quantities, like output voltage, harvested power and power efficiency. Based on our previous works, we consider an energy harvester with a matching network, interposed between the harvester and the load, that reduces the impedance mismatch between the two stages. The methodology is applied to the optimization of the matching network, allowing to maximize the global harvested power and the conversion efficiency. We show that the proposed methodology gives accurate predictions of the harvester’s performance, and that it can be used to significantly simplify the analysis, design and optimization of the device.