We present CoMargin, a new methodology to estimate collateral requirements for central counterparties (CCPs) in derivatives markets. CoMargin depends on both the tail risk of a given market participant and its interdependence with other participants. Our approach internalizes market interdependencies and enhances the stability of CCPs, thereby reducing the systemic risk concerns associated with them. CoMargin can be estimated using a model-free and scenario-based methodology, validated using formal statistical tests, and generalized to any number of market participants. We assess and illustrate our methodology using proprietary data from the Canadian Derivatives Clearing Corporation (CDCC). Our data set, the first one of its kind to be used in an academic study, includes daily observations of the actual trading positions of all CDCC members from 2003 to 2011. We show theoretically and empirically that CoMargin outperforms existing margining systems by stabilizing the probability and minimizing the shortfall of simultaneous margin-exceeding losses. The relative performance of our methodology increases when trading similarities across clearing members or co-movements among underlying assets increase, as was the case during the recent financial crisis.