For application of triboelectric nanogenerators (TENG), it is essential to design TENG with high energy conversion efficiency, and it is one of the crucial parts to obtain TENG designs with optimal output impedance to match with that of application systems. Current design processes are incapable of optimizing TENGs with complex structures effectively, which greatly prolongs the research and development process and hinders application of TENGs. Here, a universal computer aided design automation is proposed to generate the structural and material design of TENG for optimal power output under designated matching resistance. A semi-analytical method and a non-dominated sorting genetic algorithm (NSGA-II) are used for the design automation. For demonstration, design automation for freestanding rotational TENG (FR-TENG) is carried out. An acceleration factor of up to ∼900 is obtained with systematical simulation acceleration. A group of designs with optimal powers and matching resistances are obtained, from which different input impedances of power management units can be obtained for applications. For verification, a FR-TENG with an optimal average output power over 88 mW is designed and fabricated, the output impedance is intentionally chosen from pareto-optimal front to match the input impedance of the subsequent power management unit. This is used to develop a fully self-powered wireless humidity/temperature/ultraviolet environmental monitoring system. This system can transmit the sensing information every ∼ 7 s and display on a remote terminal, validating the effectiveness of the proposed design automation method.