We calculate the hydrogen and helium-ionizing radiation escaping star forming molecular clouds, as a function of the star cluster mass and compactness, using a set of high-resolution radiation-magneto-hydrodynamic simulations of star formation in selfgravitating, turbulent molecular clouds. In these simulations, presented in He, Ricotti and Geen (2019), the formation of individual massive stars is well resolved, and their UV radiation feedback and lifetime on the main sequence are modelled selfconsistently. We find that the escape fraction of ionizing radiation from molecular clouds, f MC esc , decreases with increasing mass of the star cluster and with decreasing compactness. Molecular clouds with densities typically found in the local Universe have negligible f MC esc , ranging between 0.5% to 5%. Ten times denser molecular clouds have f MC esc ≈ 10% − 20%, while 100× denser clouds, which produce globular cluster progenitors, have f MC esc ≈ 20% − 60%. We find that f MC esc increases with decreasing gas metallicity, even when ignoring dust extinction, due to stronger radiation feedback. However, the total number of escaping ionizing photons decreases with decreasing metallicity because the star formation efficiency is reduced. We conclude that the sources of reionization at z > 6 must have been very compact star clusters forming in molecular clouds about 100× denser than in today's Universe, which lead to a significant production of old globular clusters progenitors.Recently, a handful of galaxies at high redshifts have been confirmed to have large Lyman continuum (LyC) escape fractions. Ion2 and Q1549-C25 are the only two z ∼ 3 galaxies with a direct spectroscopic detection of uncontaminated LyC emission (Vanzella et al. 2016;Shapley et al. 2016). Escape fractions of 50% is inferred for both of them. Vanzella et al. (2018) reported the highest redshift individually-confirmed LyC-leaky galaxy, Ion3, at z = 4. As a proxy for high-z galaxies, Izotov et al. (2018) selected local compact star-forming galaxies in the redshifts range z = 0.2993 − 0.4317, using the Cosmic Origins Spectrograph on HST. They found LyC emission with f esc in a range of 2-72 per cent. We should note that f gal esc in models of reion-