One of the most famous and robust findings in international economics is that distance has a strong negative effect on trade. Bernard, Jensen, Redding, and Schott (2007) discuss how this can be decomposed into an effect due to the number of products and an effect due to average exports per product. Using US firm-level data, they show that distance has a strong negative effect on the number of products exported. However, they find that the intensive margin-average sales of individual products-is increasing with distance. We show that this apparently puzzling finding is consistent with models featuring firm heterogeneity in productivity and fixed costs associated with exporting to each market. We also show how evidence of this type can be used to derive new estimates of how distance affects fixed and variable trade costs and how these two costs combine to generate the distance effect on trade.