Gas huff and puff (HnP) is one of the means to improve shale oil recovery, and the commonly used gases are CO 2 and N 2 . However, the current research on CO 2 and N 2 HnP enhancing shale oil recovery is not sufficient. This study compares the macroscopic exploitation and microscopic mobilization characteristics of CO 2 and N 2 HnP by the HnP experiments with a full-diameter core, gas chromatography−mass spectrometry (GC-MS) tests, and online nuclear magnetic resonance (NMR) tests. Moreover, the impact of cycle number on the oil recovery efficiency of HnP is analyzed. The results show that CO 2 HnP achieves a 7.23% higher final oil recovery factor (ORF) compared to N 2 HnP and CO 2 has a stronger injection capacity. Moreover, CO 2 has a better extraction ability, and the CO 2 HnP process can realize the storage of CO 2 . Furthermore, the lower limit of pore mobilization for CO 2 HnP is significantly lower, and the final ORF from micropores during CO 2 HnP is 20.98% higher than that during N 2 HnP. In summary, CO 2 HnP has a stronger recovery effect compared to N 2 HnP. As the cycle number grows, the incremental ORF decreases, while the growth rate of cumulative ORF slows down, and the produced gas−oil ratio (GOR) rises rapidly. Meanwhile, the gas injection volume increases and the gas−oil exchange ratio decreases. These indicate that the oil recovery effect and economic efficiency of HnP deteriorate with an increase in the cycle number.