This study examined the effect of adding xanthan gum, a biopolymer, on the compaction characteristics of clayey soil. Standard Proctor compaction tests were performed on soil samples with 1%, 2%, and 3% xanthan gum by weight. The tests showed that as the percentage of xanthan gum increased, the optimum moisture content increased and the maximum dry density decreased. This is because the biopolymer increases the viscosity and dispersal of soil particles, reducing density but allowing more water absorption. Strength properties initially increased up to 2% gum but then decreased. The study demonstrated that xanthan gum can improve soil characteristics in a cost-effective and environmentally friendly manner.