Understanding the reaction mechanisms of dehydrogenative Caryl–Caryl coupling is the key to directed formation of π-extended polycyclic aromatic hydrocarbons. Here we utilize isotopic labeling to identify the exact pathway of cyclodehydrogenation reaction in the on-surface synthesis of model atomically precise graphene nanoribbons (GNRs). Using selectively deuterated molecular precursors, we grow seven-atom-wide armchair GNRs on a Au(111) surface that display a specific hydrogen/deuterium (H/D) pattern with characteristic Raman modes. A distinct hydrogen shift across the fjord of Caryl–Caryl coupling is revealed by monitoring the ratios of gas-phase by-products of H2, HD, and D2 with in situ mass spectrometry. The identified reaction pathway consists of a conrotatory electrocyclization and a distinct [1,9]-sigmatropic D shift followed by H/D eliminations, which is further substantiated by nudged elastic band simulations. Our results not only clarify the cyclodehydrogenation process in GNR synthesis but also present a rational strategy for designing on-surface reactions towards nanographene structures with precise hydrogen/deuterium isotope labeling patterns.