Bipedal locomotion evolved along the archosaurian lineage to birds, shifting from “hip-based” to “knee-based” mechanisms. However, the roles of individual muscles in these changes and their evolutionary timings remain obscure. Using 13 three-dimensional musculoskeletal models of the hindlimbs of bird-line archosaurs, we quantify how the moment arms (i.e., leverages) of 35 locomotor muscles evolved. Our results support two hypotheses: From early theropod dinosaurs to birds, knee flexors’ moment arms decreased relative to knee extensors’, and medial long-axis rotator moment arms for the hip increased (trading off with decreased hip abductor moment arms). Our results reveal how, from the Triassic Period, bipedal theropod dinosaurs gradually modified their hindlimb form and function, shifting more from hip-based to knee-based locomotion and hip-abductor to hip-rotator balancing mechanisms inherited by birds. Yet, we also discover unexpected ancestral specializations in larger Jurassic theropods, lost later in the bird-line, complicating the paradigm of gradual transformation.