Membership design involves allocating an economic good whose value to any individual depends on who else receives it. We introduce a framework for optimal membership design by combining an otherwise standard mechanism-design model with allocative externalities that depend flexibly on agents’ observable and unobservable characteristics. Our main technical result characterizes how the optimal mechanism depends on the pattern of externalities. Specifically, we show how the number of distinct membership tiers—differing in prices and potentially involving rationing—is increasing in the complexity of the externalities. This insight may help explain a number of mechanisms used in practice to sell membership goods, including musical artists charging below-market-clearing prices for concert tickets, heterogeneous pricing tiers for access to digital communities, the use of vesting and free allocation in the distribution of network tokens, and certain admission procedures used by colleges concerned about the diversity of the student body.