Pectins are fundamental polysaccharides in the plant primary cell wall. Pectins are synthesized and secreted to cell walls as highly methyl-esterified polymers and then demethyl-esterified by pectin methylesterases (PMEs), which are spatially regulated by pectin methylesterase inhibitors (PMEIs). Although PME and PMEI genes are pivotal in plant cell wall formation, few studies have focused on the evolutionary patterns of the PME and PMEI gene families. In this study, the gene origin, evolution, and expression diversity of these two families were systematically analyzed using 11 representative species, including algae, bryophytes, lycophytes and flowering land plants. The results show that 1) for the two subfamilies (PME and proPME) of PME, the origin of the PME subfamily is consistent with the appearance of pectins in early charophyte cell walls, 2) Whole genome duplication (WGD) and tandem duplication contribute to the expansion of proPME and PMEI families in land plants, 3) Evidence of selection pressure shows that the proPME and PMEI families have rapidly evolved, particularly the PMEI family in vascular plants, and 4) Comparative expression profile analysis of the two families indicates that the eudicot Arabidopsis and monocot rice have different expression patterns. In addition, the gene structure and sequence analyses show that the origin of the PMEI domain may be derived from the neofunctionalization of the pro domain after WGD. This study will advance the evolutionary understanding of the PME and PMEI families and plant cell wall development.