Piston engines are typically considered devices converting chemical energy into mechanical power via internal combustion. But more generally, their ability to provide high-pressure and high-temperature conditions for a limited time means they can be used as chemical reactors where reactions are initiated by compression heating and subsequently quenched by gas expansion. Thus, piston engines could be "polygeneration" reactors that can flexibly change from power generation to chemical synthesis, and even to chemical-energy storage. This may help mitigating one of the main challenges of future energy systemsaccommodating fluctuations in electricity supply and demand. Investments in devices for grid stabilization could be more economical if they have a second use.This paper presents a systematic approach to polygeneration9 in piston engines, combining thermodynamics, kinetics, numerical optimization, engineering, and thermo-economics. A focus is on the fuel-rich conversion of methane as a fuel that is considered important for the foreseeable future. Starting from thermodynamic theory and kinetic modeling, promising systems are selected. Mathematical optimization and an array of experimental kinetic investigations are used for model improvement and development. To evaluate technical feasibility, experiments are then performed in both a single-stroke rapid compression machine and a reciprocating engine. In both cases, chemical conversion is initiated by homogeneous-charge compression-ignition. A thermodynamic and thermo-economic assessment of the results is positive. Examples that illustrate how the piston engine can be used in polygeneration processes to convert methane to higher-value chemicals or to take up carbon dioxide are presented. Open issues for future research are addressed.