7 Processing in cortical circuits is driven by combinations of cortical and subcortical inputs. These signals 8 are often conceptually categorized as bottom-up input, conveying sensory information, and top-down 9 input, conveying contextual information. Using intracellular recordings in mouse visual cortex, we 10 measured neuronal responses to visual input, locomotion, and visuomotor mismatches. We show that 11 layer 2/3 (L2/3) neurons compute a difference between top-down motor-related input and bottom-up 12 visual flow input. Most L2/3 neurons responded to visuomotor mismatch with either hyperpolarization 13 or depolarization, and these two response types were associated with distinct physiological properties. 14 Consistent with a subtraction of bottom-up and top-down input, visual and motor-related inputs had 15 opposing influence in L2/3 neurons. In infragranular neurons, we found no evidence of a difference-16 computation and responses were consistent with a positive integration of visuomotor inputs. Our 17 results provide evidence that L2/3 functions as a bidirectional comparator of top-down and bottom-up 18 input. 19stimuli were presented at random intervals (mean ± SD, 8.1 ± 1.3 s), regardless of locomotion behavior. 595