This paper discusses and evaluates the representation of atmospheric chemistry in the global Community Atmosphere Model (CAM) version 4, the atmospheric component of the Community Earth System Model (CESM). A variety of configurations for the representation of tropospheric and stratospheric chemistry, wet removal, and online and offline meteorology are presented. Results from simulations illustrating these configurations are compared with surface, aircraft and satellite observations. Major biases include a negative bias in the high-latitude CO distribution, a positive bias in upper-tropospheric/lower-stratospheric ozone, and a positive bias in summertime surface ozone (over the United States and Europe). The tropospheric net chemical ozone production varies significantly between configurations, partly related to variations in stratosphere-troposphere exchange. Aerosol optical depth tends to be underestimated over most regions, while comparison with aerosol surface measurements over the United States indicate reasonable results for sulfate , especially in the online simulation. Other aerosol species exhibit significant biases. Overall, the model-data comparison indicates that the offline simulation driven by GEOS5 meteorological analyses provides the best simulation, possibly due in part to the increased vertical resolution (52 levels instead of 26 for online dynamics). The CAM-chem code as described in this paper, along with all the necessary datasets needed to perform the simulations described here, are available for download at www.cesm.ucar.edu.