We consider the invertibility (injectivity) of a nonparametric nonseparable demand system. Invertibility of demand is important in several contexts, including identification of demand, estimation of demand, testing of revealed preference, and economic theory exploiting existence of an inverse demand function or (in an exchange economy) uniqueness of Walrasian equilibrium prices. We introduce the notion of “connected substitutes” and show that this structure is sufficient for invertibility. The connected substitutes conditions require weak substitution between all goods and sufficient strict substitution to necessitate treating them in a single demand system. The connected substitutes conditions have transparent economic interpretation, are easily checked, and are satisfied in many standard models. They need only hold under some transformation of demand and can accommodate many models in which goods are complements. They allow one to show invertibility without strict gross substitutes, functional form restrictions, smoothness assumptions, or strong domain restrictions. When the restriction to weak substitutes is maintained, our sufficient conditions are also “nearly necessary” for even local invertibility.