Margin and collateral agreements have become one of the most important and widespread credit risk mitigation techniques in financial markets. Empirically we decompose swap spreads into their credit risk factors and study the impact of credit risk and margin agreement on the market spreads. We find empirical evidence that collateralization can always improve recovery and reduce credit risk. We also find that counterparty risk alone cannot overly explain credit-related spreads. Instead, only the joint effects of collateralization and credit risk can sufficiently interpret unsecured credit costs. This finding suggests that failure to properly account for collateralization may result in significant mispricing of financial contracts.