This work addresses nonperturbative effects in both matrix models and topological strings, and their relation with the large-order behavior of the 1/N expansion. We study instanton configurations in generic one-cut matrix models, obtaining explicit results for the one-instanton amplitude at both one and two loops. The holographic description of topological strings in terms of matrix models implies that our nonperturbative results also apply to topological strings on toric Calabi-Yau manifolds. This yields very precise predictions for the large-order behavior of the perturbative genus expansion, both in conventional matrix models and in topological string theory. We test these predictions in detail in various examples, including the quartic matrix model, topological strings on the local curve, and Hurwitz theory. In all these cases we provide extensive numerical checks which heavily support our nonperturbative analytical results. Moreover, since all these models have a critical point describing two-dimensional gravity, we also obtain in this way the large-order asymptotics of the relevant solution to the Painleve I equation, including corrections in inverse genus. From a mathematical point of view, our results predict the large-genus asymptotics of simple Hurwitz numbers and of local Gromov-Witten invariants.