We use density functional theory calculations to explore different polymorphs of a new class of 2D materials commonly known as MXenes,which are primarily carbides and nitrides of transition metals. The stability of the M2X, M3X2, and M4X3 polymorphs in their bare and functionalized forms is assessed via the calculated standard heat of formation. We find that most of the MXenes are metallic, and we investigate their performance as electrocatalysts for the hydrogen evolution reaction(HER) using the free energy of hydrogen adsorption at equilibrium coverage as an activity descriptor. For a given type of metal, we find that the hydrogen adsorption energy can vary by up to 0.5 eV depending on the number of metal layers in the structure, suggesting that the catalytic activity of MXenes can be tuned by controlling the layer thickness. On the basis of a combined stability and activity analysis of 72 different MXenes, we identify several new promising nonprecious HER electrocatalysts.