With a compact neural circuit consisting of entirely mapped 302 neurons, Caenorhabditis elegans plays an important role in the development and application of optogenetics. Application of optogenetics in C. elegans accelerates the studies of neural circuits by offering the tools that drastically change experimental designs with increasing accessibility for neural activity. Combination with a different approach, such as electrophysiology, expands the potential of both optogenetics and other approaches by increasing resolution of elucidation. Moreover, the technologies specifi cally developed in combination with optogenetics, such as patterned illumination, provide new tools to interrogate neural functions. In this chapter, we fi rst introduce the reasons to use optogenetics in C. elegans studies, and discuss the technical issues of optogenetics, especially for C. elegans . We then review early and recent milestone works using optogenetics to investigate neural and behavioral mechanisms. Note that, in this chapter, the term 'optogenetics' includes both imaging with fl uorescence probes and neural activity manipulation using opsins.