Walking and running have fundamentally different biomechanics, which makes developing devices that assist both gaits challenging. We show that a portable exosuit that assists hip extension can reduce the metabolic rate of treadmill walking at 1.5 meters per second by 9.3% and that of running at 2.5 meters per second by 4.0% compared with locomotion without the exosuit. These reduction magnitudes are comparable to the effects of taking off 7.4 and 5.7 kilograms during walking and running, respectively, and are in a range that has shown meaningful athletic performance changes. The exosuit automatically switches between actuation profiles for both gaits, on the basis of estimated potential energy fluctuations of the wearer’s center of mass. Single-participant experiments show that it is possible to reduce metabolic rates of different running speeds and uphill walking, further demonstrating the exosuit’s versatility.