The gapless surface states of topological insulators could enable quantitatively different types of electronic device. A study of the topological insulating Bi2Se3 thin films finds that a gap in these states opens up in films below a certain thickness. This in turn suggests that in thicker films, gapless states exist on both upper and lower surfaces. A topological insulator1,2,3,4,5,6,7,8,9 is a new state of quantum matter that is characterized by a finite energy gap in the bulk and gapless modes flowing along the boundaries that are robust against disorder scattering. The topological protection of the surface state could be useful for both low-power electronics10 and error-tolerant quantum computing11,12. For a thin slab of three-dimensional topological insulator, the boundary modes from the opposite surfaces may be coupled by quantum tunnelling, so that a small, thickness-dependent gap is opened up13,14,15. Here we report such results from angle-resolved photoemission spectroscopy on Bi2Se3 films of various thicknesses grown by molecular beam epitaxy. The energy gap opening is clearly seen when the thickness is below six quintuple layers. The gapped surface states also exhibit sizeable Rashba-type spin–orbit splitting because of the substrate-induced potential difference between the two surfaces. The tunable gap and the spin–orbit coupling make these topological thin films ideal for electronic and spintronic device applications.