A van passenger who squirted bleach at passers-by, including a 13-year-old schoolgirl, later told police he had only been having a laugh, a court heard.
At first the girl thought Mohammed Khan, 26, had covered her in water, but the bleach damaged her grey cardigan.
Khan, of Springbank Crescent, Huddersfield, did the same to another pedestrian, Nicola Letremy, and shouted racist abuse at her, Bradford Crown Court was told.
The incidents happened in the Penistone Road area of Huddersfield on April 22 last year.
Khan, who admitted common assault and racially-aggravated common assault, was ordered to do 180 hours’ unpaid work, pay £600 costs and £150 compensation to each of the pedestrians.
Judge Peter Benson, sentencing, said: “If that bleach had hit either of the complainants in the eyes he could have been facing a charge of causing grievous bodily harm with intent.”