The atmosphere of Mars is enriched in heavy isotopes with respect to Earth as a result of the escape of the atmosphere to space over billions of years. Estimating the enrichment in heavy isotopes due to atmospheric escape requires a rigorous understanding of all atmospheric processes that contribute to the evolution of isotopic ratios between the lower and upper atmosphere, where escape processes take place. Using a combination of vertical profiles from the Atmospheric Chemistry Suite (ExoMars Trace Gas Orbiter) with the predictions of a photochemical model, we provide evidence for a new process of photochemistry-induced fractionation that depletes the heavy isotopes of C and O in CO. Accounting for this new source of fractionation, we find that only a fraction of ≈12% of the atmosphere needs to have been lost to space through CO photochemical escape to explain the enrichment of 13C/12C in CO2 measured by the Curiosity Rover.