For a given π-conjugated polymer, the batch-to-batch variations in molecular weight (Mw) and polydispersity index (Ð) can lead to inconsistent process-dependent material properties and consequent performance variations in the device application. Using a stepwise heating protocol in the Stille polycondensation in conjunction with optimized processing, we obtained an ultrahigh-quality PTB7 polymer having high Mw and very narrow Ð. The resulting ultrahigh-quality polymer-based solar cells demonstrate up to 9.97% power conversion efficiencies (PCEs), which is over 24% enhancement from the control devices fabricated with commercially available PTB7. Moreover, we observe almost negligible batch-to-batch variations in the overall PCE values from ultrahigh-quality polymer-based devices. The proposed stepwise polymerization demonstrates a facile and effective strategy for synthesizing high-quality semiconducting polymers that can significantly improve device yield in polymer-based solar cells, an important factor for the commercialization of organic solar cells, by mitigating device-to-device variations.