The same odorant can induce attractive or repulsive responses depending on its concentration in various animals including humans. However, little is understood about the neuronal basis of this behavioural phenomenon. Here we show that Caenorhabditis elegans avoids high concentrations of odorants that are attractive at low concentrations. Behavioural analyses and computer simulation reveal that the odour concentration-dependent behaviour is primarily generated by klinokinesis, a behavioural strategy in C. elegans. Genetic analyses and lesion experiments show that distinct combinations of sensory neurons function at different concentrations of the odorant; AWC and ASH sensory neurons have critical roles for attraction to or avoidance of the odorant, respectively. Moreover, we found that AWC neurons respond to only lower concentrations of the odorant, whereas ASH neurons respond to only higher concentrations of odorant. Hence, our study suggests that odour concentration coding in C. elegans mostly conforms to the labelled-line principle where distinct neurons respond to distinct stimuli.