Welfare depends on the quantity, quality, and range of goods consumed. We use trade data, which report the quantities and prices of the individual goods that countries exchange, to learn about how the gains from trade and growth break down into these different margins. Our general equilibrium model, in which both quality and quantity contribute to consumption and to production, captures (i) how prices increase with importer and exporter per capita income, (ii) how the range of goods traded rises with importer and exporter size, and (iii) how products traveling longer distances have higher prices. Our framework can deliver a standard gravity formulation for total trade flows and for the gains from trade. We find that growth in the extensive margin contributes to about half of overall gains. Quality plays a larger role in the welfare gains from international trade than from economic growth due to selection.