Previous work on the formation and stability of cartels has focused on the case of identical players. This assumption is very restrictive in many economic environments. This paper analyses stability of cartels in games with heterogeneous players and spillovers to non-members. I introduce a sharing rule for coalition payoffs, called "optimal sharing" which stabilises all cartels that are possibly stable under any rule. Under optimal sharing the grand coalition is the unique stable cartel if spillovers are negative. I introduce a new property, called "non-essentiality" and determine the set of stable cartels under optimal sharing if spillovers are positive and if the non-essentiality property applies. Finally I analyse cartel stability under optimal sharing in simple public goods game with heterogeneous players. My results show – in contrast to earlier findings for identical players – that large coalitions may well be stable.