In this paper, we attempted to prepare microfoam by using a sandpack filled with glass beads with co-flowing gas and foaming solution, the microfoam stability and effectiveness in improving profile control capacity at micromodel and pore media were evaluated by micromodel tests and double-core experiments. The results of micromodel tests showed that microfoam stability was increased with increasing xanthan gum concentration due to a higher solution viscosity and viscoelasticity of liquid film. The xanthan gum-stabilized microfoam had a longer propagation distance through the low permeable region of heterogeneous micromodel at time of breakthrough than common microfoam, the optimum performance of microfoam for fluid diversion was multiple bubble trapping and mobilization rather than lamella division. According to the results of double-core experiments, the microfoam could plug the high permeability sandpack and improve the sweep efficiency in the low permeability sandpack, which could improve the water injection profile of porous media effectively. The increase in profile control effects had a good correspondence with the increase of xanthan gum concentration. The presented results were useful in understanding and designing microfoam injection in reservoirs for enhanced oil recovery. [ABSTRACT FROM AUTHOR]