Exchange rates strongly co-vary against their base currency. We uncover a gravity equation in this factor structure: the key determinant of a country’s exchange rate beta on the common base factor is the country’s distance from the base country. The farther the country, the larger the beta. For example, the beta of the CHF/USD exchange rate on the dollar factor is determined by the distance between Switzerland and the United States. Shared language, legal origin, shared border, resource similarity and colonial linkages also significantly lower the betas. On average, the exchange rates of peripheral countries tend to have high Rsquareds in factor regressions, while central countries have low Rsquareds. A no-arbitrage model of exchange rates replicates this distance-dependent factor structure when the exposure of pricing kernels to global risk factors is more similar for closer country pairs.