PurposeThe aim was to prepare antibacterial microcapsules and transferred to denim and non-denim (canvas) trousers.Design/methodology/approachFor this purpose, lavender and sweet almond oil as active agents were encapsulated with ethylcellulose shell with a spray dryer method and carried out capsule optimization studies.FindingsThe particle diameter of the capsules ranged between 0.61 and 8.76 µm, SPAN value was 1.608 and the mean particle size was 4 µm. The mass yields of capsules ranged between 35.0 and 75.4 %w/w. Denim fabrics were treated with prepared capsules by exhaustion and spraying methods. It was seen that microcapsules provided a reduction of bacteria by over 97% against both Staphylococcus aureus and Escherichia coli and the fabrics still showed an antibacterial effect after five washing cycles.Originality/valueWhen application methods were compared, the spraying method was found to be more sustainable process than exhaustion and could be used as an alternative for reducing energy consumption and capsules could provide antibacterial properties to the fabrics.