A potentially serious impediment to the production of energy by nuclear fusion in large tokamaks, such as ITER [R. Aymar, V. A. Chuyanov, M. Huguet, Y. Shimomura, ITER Joint Central Team, and ITER Home Teams, Nucl. Fusion 41, 1301 (2001)]and DEMO [D. Maisonner, I. Cook, S. Pierre, B. Lorenzo, D. Luigi, G. Luciano, N. Prachai, and P. Aldo, Fusion Eng. Des. 81, 1123 (2006)], is the potential for rapid deposition of energy onto plasma facing components by edge localized modes (ELMs). The trigger for ELMs is believed to be the ideal magnetohydrodynamic peeling-ballooning instability, but recent numerical calculations have suggested that a plasma equilibrium with an X-point—as is found in all ITER-like tokamaks, is stable to the peeling mode. This contrasts with analytical calculations [G. Laval, R. Pellat, and J. S. Soule, Phys. Fluids 17, 835 (1974)] that found the peeling mode to be unstable in cylindrical plasmas with arbitrary cross-sectional shape. Here, we re-examine the assumptions made in cylindrical geometry calculations and generalize the calculation to an arbitrary tokamak geometry at marginal stability. The resulting equations solely describe the peeling mode and are not complicated by coupling to the ballooning mode, for example. We find that stability is determined by the value of a single parameter that is the poloidal average of the normalized jump in the radial derivative of the perturbed magnetic field’s normal component. We also find that near a separatrix it is possible for the energy principle’s W to be negative that is usually taken to indicate that the mode is unstable, as in the cylindrical theory , but the growth rate to be arbitrarily small.