Unicellular organisms naturally form multicellular communities, differentiate into specialized cells, and synchronize their behaviour under certain conditions. Swarming, defined as a movement of a large mass of bacteria on solid surfaces, is recognized as a preliminary step in the formation of biofilms. The main aim of this work was to study the role of a group of genes involved in exopolysaccharide biosynthesis during pellicle formation and swarming in Bacillus subtilis strain 168. To assess the role of particular proteins encoded by the group of epsI-epsO genes that form the eps operon, we constructed a series of insertional mutants. The results obtained showed that mutations in epsJ-epsN, but not in the last gene of the eps operon (epsO), have a severe effect on pellicle formation under all tested conditions. Moreover, the inactivation of 5 out of the 6 genes analysed caused total inhibition of swarming in strain 168 (that does not produce surfactin) on LB medium. Following restoration of the sfp gene (required for production of surfactin, which is essential for swarming of the wild-type bacteria), the sfp+ strains defective in eps genes (except epsO) generated significantly different patterns during swarming on synthetic B medium, as compared to the parental strain 168 sfp+.