Gears are rotating machines, meshing with each other by teeth to transmit torque. Interestingly, the rotating directions of two meshing gears are opposite, clockwise and counterclockwise. Although this opposite handedness motion has been widely investigated in machinery science, the analogue behavior of photons remains undiscovered. Here, we present a simple nanophotonic directional coupler structure which can generate two meshing gears of angular momentum (AM) of light, optical gears. Due to the abrupt phase shift effect and birefringence effect, the AM states of photons vary with the propagation distance in two adjacent waveguides of the coupler. Thus, by the choice of coupling length, it is able to obtain two light beams with opposite handedness of AM, confirming the appearance of optical gears. The full control in the handedness of output beams is achieved via tuning the relative phase between two orthogonal modes at the input ports. Optical gears thus offer the possibility of exploring light-matter interactions in nanoscale, opening up new avenues in fields of integrated quantum computing and nanoscale bio-sensing of chiral molecules.