The importance of molecular flexibility to a system's behaviour has long been recognised. However, flexibility is often only understood at a qualitative or indirect level. There is still no general way to quantify the effective number of configurations of a system, a number closely related to entropy and thus stability. The main challenges to solve are the enormous number of configurations and the strong intermolecular correlations. Here we describe a general simulation-based method to quantify molecular flexibility, entropy and thus stability. The three kinds of quantity taken from a simulation are energies, forces and atomic contacts. We show how our method predicts stability for a range of progressively more complex systems, including water, aqueous solutions, complexes and other organic liquids. The method yields extensive insight into a system's structure and dynamics, and its simplicity makes it both understandable to non-experts and scalable to large, complex systems.