Quantitative models and experiments are revealing how the folding free energy surface of a protein is sculpted by sequence and environment. The sometimes conflicting demands of folding, structure and function determine which folding pathways, if any, dominate. Recent advances include experimental estimates of diffusive barrier-crossing times, the observation of ultrafast folders amenable to full-atom simulation, the use of thermodynamic tuning and nonconservative mutations to probe 'hidden' parts of the free energy surface, and a complete microscopic theory of folding.