Determining the stability ofmolecules and condensed phases is the cornerstone of atomisticmodeling, underpinning our understanding of chemical andmaterials properties and transformations. We show that amachine-learningmodel, based on a local description of chemical environments and Bayesian statistical learning, provides a unified framework to predict atomic-scale properties. It captures the quantum mechanical effects governing the complex surface reconstructions of silicon, predicts the stability of different classes of molecules with chemical accuracy, and distinguishes active and inactive protein ligands with more than 99% reliability. The universality and the systematic nature of our framework provide new insight into the potential energy surface of materials and molecules.