The Diels–Alder reaction is one of the most popular reactions in organic chemistry. However, its use in the field of on-surface synthesis is hampered by the spatial restrictions of this cycloaddition reaction. Herein we selected a cyclic strained triyne to demonstrate an on-surface hexadehydro-Diels–Alder reaction in a single molecule. The reaction was studied in detail by means of atomic force microscopy (AFM) with CO-functionalized tips. Our results pave the way to use this iconic pericyclic reaction for on-surface synthesis, introducing the concept of atom economy in the field.