We show that a firm's CSR policy is significantly influenced by the CSR policies of firms in the same three-digit zip code, an effect possibly due to investor clienteles, local competition, and/or social interactions. We then exploit the variation in CSR across the zip codes to estimate the effect of CSR on credit ratings under the assumption that zip code assignments are exogenous. We find that more socially responsible firms enjoy more favorable credit ratings. In particular, an increase in CSR by one standard deviation improves the firm's credit rating by as much as 4.5%.