Wastewater from the cotton fabric dyeing process causes high levels of environmental pollution. In order to address this problem, this study used a series of biodegradable surfactants in cotton fabric dyeing and applied the Taguchi method to analyse the optimal parameters of cotton fabric dyeing by such surfactants. The test parameters included the hydrophobic group chain length of the surfactant, and surfactant concentration and the processing time. This study calculated the signal‐to‐noise ratio of the experimental results by the‐larger‐the‐better characteristic and applied analysis of variance to discuss its impact on the dyeing results. The results confirmed that the most important influential factor is processing time, followed by surfactant concentration. Moreover, the addition of surfactant could promote a dyeing effect during processing.