We exploit the implementation of a rural pension policy in China to estimate the average rural‐to‐urban migration cost for workers affected by the policy and the average underlying sectoral productivity difference. Our estimates, based on a large panel data set, reveal significant migration costs and substantial sectoral productivity differences, with sorting playing a minor role in accounting for sectoral labor income gaps. We construct and structurally estimate a general equilibrium household model with endogenous labor supply and migration. The results of this model align with the reduced‐form findings and illustrate how the rural pension policy influences migration, GDP, and welfare through improving within‐household labor allocation. Counterfactual analyses based on the model show that the positive effects of the policy remain even if migration costs were significantly lower, and that scaling up the rural pension policy would lead to even larger improvements in labor allocation, GDP, and welfare.