Most stars and their planets form in open clusters. Over 95 per cent of such clusters have stellar densities too low (less than a hundred stars per cubic parsec) to withstand internal and external dynamical stresses and fall apart within a few hundred million years. Older open clusters have survived by virtue of being richer and denser in stars (1,000 to 10,000 per cubic parsec) when they formed. Such clusters represent a stellar environment very different from the birthplace of the Sun and other planet-hosting field stars. So far more than 800 planets have been found around Sun-like stars in the field. The field planets are usually the size of Neptune or smaller. In contrast, only four planets have been found orbiting stars in open clusters, all with masses similar to or greater than that of Jupiter. Here we report observations of the transits of two Sun-like stars by planets smaller than Neptune in the billion-year-old open cluster NGC6811. This demonstrates that small planets can form and survive in a dense cluster environment, and implies that the frequency and properties of planets in open clusters are consistent with those of planets around field stars in the Galaxy.