Effectively harvesting ambient mechanical energy is the key for realizing self-powered and autonomous electronics, which addresses limitations of batteries and thus has tremendous applications in sensor networks, wireless devices, and wearable/implantable electronics, etc. Here, a thin-film-based micro-grating triboelectric nanogenerator (MG-TENG) is developed for high-efficiency power generation through conversion of mechanical energy. The shape-adaptive MG-TENG relies on sliding electrification between complementary micro-sized arrays of linear grating, which offers a unique and straightforward solution in harnessing energy from relative sliding motion between surfaces. Operating at a sliding velocity of 10 m/s, a MG-TENG of 60 cm2 in overall area, 0.2 cm3 in volume and 0.6 g in weight can deliver an average output power of 3 W (power density of 50 mW cm−2 and 15 W cm−3) at an overall conversion efficiency of ∼50%, making it a sufficient power supply to regular electronics, such as light bulbs. The scalable and cost-effective MG-TENG is practically applicable in not only harvesting various mechanical motions but also possibly power generation at a large scale.