We propose a theory of task trade between countries that have similar relative factor endowments but may differ in size. Firms produce differentiated goods by performing a continuum of tasks, each of which generates local spillovers. Tasks can be performed at home or abroad, but offshoring entails costs that vary by task. In equilibrium, the tasks with the highest offshoring costs may not be traded. Among the remainder, those with the relatively higher offshoring costs are performed in the country that has the higher wage and higher aggregate output. We discuss the relationship between equilibrium wages, equilibrium outputs, and relative country size and examine how the pattern of specialization reflects the key parameters of the model.