Cytoskeletal molecular motors belonging to the kinesin and dynein families transport cargos (for example, messenger RNA, endosomes, virus) on polymerized linear structures called microtubules in the cell. These 'nanomachines' use energy obtained from ATP hydrolysis to generate force, and move in a step-like manner on microtubules. Dynein has a complex and fundamentally different structure from other motor families. Thus, understanding dynein's force generation can yield new insight into the architecture and function of nanomachines. Here, we use an optical trap to quantify motion of polystyrene beads driven along microtubules by single cytoplasmic dynein motors. Under no load, dynein moves predominantly with a mixture of 24-nm and 32-nm steps. When moving against load applied by an optical trap, dynein can decrease step size to 8 nm and produce force up to 1.1 pN. This correlation between step size and force production is consistent with a molecular gear mechanism. The ability to take smaller but more powerful strokes under load--that is, to shift gears--depends on the availability of ATP. We propose a model whereby the gear is downshifted through load-induced binding of ATP at secondary sites in the dynein head.