Chemotaxis in Caenorhabditis elegans, like chemotaxis in bacteria, involves a random walk biased by the time derivative of attractant concentration, but how the derivative is computed is unknown. Laser ablations have shown that the strongest deficits in chemotaxis to salts are obtained when the ASE chemosensory neurons (ASEL and ASER) are ablated, indicating that this pair has a dominant role. Although these neurons are left-right homologues anatomically, they exhibit marked asymmetries in gene expression and ion preference. Here, using optical recordings of calcium concentration in ASE neurons in intact animals, we demonstrate an additional asymmetry: ASEL is an ON-cell, stimulated by increases in NaCl concentration, whereas ASER is an OFF-cell, stimulated by decreases in NaCl concentration. Both responses are reliable yet transient, indicating that ASE neurons report changes in concentration rather than absolute levels. Recordings from synaptic and sensory transduction mutants show that the ON-OFF asymmetry is the result of intrinsic differences between ASE neurons. Unilateral activation experiments indicate that the asymmetry extends to the level of behavioural output: ASEL lengthens bouts of forward locomotion (runs) whereas ASER promotes direction changes (turns). Notably, the input and output asymmetries of ASE neurons are precisely those of a simple yet novel neuronal motif for computing the time derivative of chemosensory information, which is the fundamental computation of C. elegans chemotaxis. Evidence for ON and OFF cells in other chemosensory networks suggests that this motif may be common in animals that navigate by taste and smell.