We perform a global stability analysis of a flapping flag in the conventional configuration, in which the flag is pinned or clamped at its leading edge, and in the inverted configuration, in which the flag is clamped at its trailing edge. Specifically, we consider fully coupled fluid-structure interaction for two-dimensional flags at low Reynolds numbers. For the conventional configuration, we show that the unstable global modes accurately predict the onset of flapping for a wide range of mass and stiffness ratios. For the inverted configuration, we identify a stable deformed equilibrium state and demonstrate that as the flag becomes less stiff, this equilibrium undergoes a supercritical Hopf bifurcation in which the least damped mode transitions to instability. Previous stability analyses of inverted flags computed the leading mode of the undeformed equilibrium state and found it to be a zero-frequency (non-flapping) mode, which does not reflect the inherent flapping behavior. We show that the leading mode of the deformed equilibrium is associated with a non-zero frequency, and therefore offers a mechanism for flapping. We emphasize that for both configurations the global modes are obtained from the fully-coupled flow-flag system, and therefore reveal both the most dominant flag shapes and the corresponding flow structures that are pivotal to flag flapping behavior.