The full stellar population of NGC 6334, one of the most spectacular regions of massive star formation in the nearby Galaxy, have not been well-sampled in past studies. We analyze here a mosaic of two Chandra X-ray Observatory images of the region using sensitive data analysis methods, giving a list of 1607 faint X-ray sources with arcsecond positions and approximate line-of-sight absorption. About 95 percent of these are expected to be cluster members, most lower mass pre-main sequence stars. Extrapolating to low X-ray levels, the total stellar population is estimated to be 20-30,000 pre-main sequence stars. The X-ray sources show a complicated spatial pattern with about 10 distinct star clusters. The heavily-obscured clusters are mostly associated with previously known far-infrared sources and radio HII regions. The lightly-obscured clusters are mostly newly identified in the X-ray images. Dozens of likely OB stars are found, both in clusters and dispersed throughout the region, suggesting that star formation in the complex has proceeded over millions of years. A number of extraordinarily heavily absorbed X-ray sources are associated with the active regions of star formation.