Abstract Current oil recovery methods in hydraulically fractured shale reservoirs have a low recovery efficiency of about 10%. The objective of this work is to investigate the effectiveness of nitrogen and supercritical carbon dioxide in the huff-and-puff method for enhanced oil recovery as a means to re-energize reservoirs and improve recovery rates. We conduct direct visualization experiments with a microfluidic system to reveal the mechanisms and to quantify the recovery rates of oil from fracture networks. We compared the effectiveness of water, nitrogen and supercritical carbon dioxide at reservoir conditions in a process mimicking the huff-and-puff method in both dead-end and connected fracture systems. The microfluidic chips were made of glass and placed in a confining pressure system pressurized to 10 MPa, 50 °C. The system was allowed to equilibrate, and then depressurized to simulate huff-and-puff oil recovery. Fluorescence microscope images were continuously taken to visualize and calculate residual oil saturation as a function of pressure drawdown. As the system was depressurized from 10 MPa, gas exsolution from the oil liquid phase, including bubble nucleation, growth, and coalescence, appeared to be the main driver for mobilizing oil from the fracture networks. Injection of supercritical CO2 resulted in the highest recovery rate with an average end-point recovery of about 90% in the connected fracture network and 60% in the dead-end fracture network. N2 has lower solubility in oil and hence showed a lower recovery rate of 40% in the connected fracture network and 25% in the dead-end fracture network. Injection of water had no effect on oil mobilization since water is insoluble, immiscible and incompressible. The main mechanism of enhanced recovery was gas exsolution from the liquid phase as pressure was decreased below the bubble point pressure. Because the gas was distributed throughout the oil phase, bubble nucleation, growth, coalescence, and elongation occurred throughout the fracture network. Expansion of the gas forced oil out of the network through piston displacement in continuous oil areas and film flow in the dispersed oil areas. Bubbles began as spheres and grew until they touched the fracture walls where they elongated along the fracture length. The bubble growth rate depended on local mass transfer from liquid to gas phase and gas volume expansion due to pressure drop. The efficiency of the huff-and-puff process is dependent on the solubility and miscibility of the injection fluid with oil. High gas solubility allows for more bubble nucleation, growth and expansion during the depressurization cycle.