Cyclo[n]carbons (Cn) have recently attracted significant attentions owing to their geometric and electronic structures remaining largely unexplored in the condensed phase1-15. On-surface synthesis has demonstrated advantage for the generation of a series of cyclocarbons, for example, C1816,17, C1618, C1419, C1019 on the NaCl surface, and their geometric structures have been revealed in real space. However, endeavors to synthesize larger cyclocarbons (e.g., C20 or C24) have encountered difficulties owing to the unstability of precursor molecules18. Meanwhile, it has been extremely challenging to probe the electronic structures of cyclocarbons due to their high mobilities on the NaCl surface. In this study, we focus another two anti-aromatic cyclocarbons, the last and the next homologue of C16, that is, C12 and C20. By designing two fully halogenated molecular precursors both including 4-numbered rings, we further extend the on-surface retro-Bergman ring-opening reaction, and successfully produce the C12 and C20. Such a strategy is also very recently followed by Gross and Anderson's groups to produce C1320. The polyynic structures of C12 and C20 were unambiguously revealed by bond-resolved atomic force microscopy (AFM). More importantly, subtly positioning the C20 molecule into an “atomic fence” formed by Cl clusters allows to experimentally probe its frontier molecular orbitals, yielding a HOMO-LUMO bandgap of 3.8 eV measured from scanning tunneling spectroscopy. Our work may open up the field by easier synthesis of a series of cyclocarbons via on-surface retro-Bergman ring-opening strategy.