In most cases, sandstone reservoirs contain clay particles. When a fluid with low salt content is injected into the reservoir, clay particles swell, and the rock's permeability decreases. Since surfactant flooding with water that has lower salinity than formation water is used to improve oil recovery, this study examines the swelling inhibitive strength of various surfactants. The study investigates the effect of surfactants on clay swelling inhibition through linear swelling and sedimentation experiments which showed that cetyl trimethyl ammonium bromide (CTAB) inhibits clay swelling. The optimum CTAB concentration was found to be 1 wt.%. However, sodium dodecyl sulphate (SDS) and Triton X‐100 (TX‐100) did not inhibit clay swelling. Sandpack experiments confirmed that CTAB prevented clay swelling and sandpack permeability reduction, while SDS and TX‐100 did not. The injection pressure results for the different surfactants were as follows: CTAB—39 psi, SDS—203 psi, TX‐100—223 psi, deionized water (DW)—324 psi, and KCl—78 psi. The mechanism of surfactant performance in affecting clay swelling was investigated based on thermal gravimetric analysis (TGA), zeta potential, and scanning electron microscope (SEM) images. The results showed that CTAB compensates for the surface charge of clays through a cation exchange mechanism. The amount of absorbed water for clays modified with CTAB was lower than that for other surfactants. The SEM images confirmed that the CTAB‐modified clays were larger and did not disintegrate during dispersion; however, in other cases, the particle size was smaller.