Innovation depends on exporting and, in particular, on scale and competition in export markets. We develop a theory featuring (1) quality-segmented markets, (2) step-by-step innovation that moves firms forward along the quality ladder, and (3) escape-the-competition motives for innovation. We derive four predictions about the impact on innovation of scale and competition: a firm with a large and less-competitive quality segment ahead or forward of it will have strong incentives to innovate into this profitable segment, while a firm with a small and more-competitive quality segment behind it will also have strong incentives to innovate for fear of facing firms in this segment in the future. We take these predictions to Chinese firm-level data during a period of explosive export growth (2000-2006). Using information about scale and competition by quality segment in China‘s export markets, we confirm all four hypotheses. By implication, and unlike in standard CES models, the impact of trade on innovation depends critically on how it drives scale and competition in high- versus low-quality segments.