For millenia, legged locomotion has been of central importance to humans for hunting, agriculture, transportation, sport, and warfare. Today, the same principal considerations of locomotor performance and economy apply to legged systems designed to serve, assist, or be worn by humans in urban and natural environments. Energy comes at a premium not only for animals, wherein suitably fast and economical gaits are selected through organic evolution, but also for legged robots that must carry sufficient energy in their batteries. Although a robot's energy is spent at many levels, from control systems to actuators, we suggest that the mechanical cost of transport is an integral energy expenditure for any legged system-and measuring this cost permits the most direct comparison between gaits of legged animals and robots. Although legged robots have matched or even improved upon total cost of transport of animals, this is typically achieved by choosing extremely slow speeds or by using regenerative mechanisms. Legged robots have not yet reached the low mechanical cost of transport achieved at speeds used by bipedal and quadrupedal animals. Here we consider approaches used to analyze gaits and discuss a framework, termed mechanical cost analysis, that can be used to evaluate the economy of legged systems. This method uses a point mass perspective to evaluate the entire stride as well as to identify individual events that accrue mechanical cost. The analysis of gait began at the turn of the last century with spatiotemporal analysis facilitated by the advent of cine film. These advances gave rise to the "gait diagram," which plots duty factors and phase separations between footfalls. This approach was supplanted in the following decades by methods using force platforms to determine forces and motions of the center of mass (CoM)-and analytical models that characterize gait according to fluctuations in potential and kinetic energy. Mechanical cost analysis draws from these approaches and provides a unified framework that interprets the spatiotemporal sequencing of leg contacts within the context of CoM dynamics to determine mechanical cost in every instance of the stride. Diverse gaits can be evaluated and compared in biological and engineered systems using mechanical cost analysis.