Ultrafine particles (UFPs) dominate the particle number population in the urban atmosphere and revealing their chemical composition is important. The thermal desorption chemical ionization mass spectrometer (TDCIMS) can semicontinuously measure UFP composition at the molecular level. We modified a TDCIMS and deployed it in urban Beijing. Radioactive materials in the TDCIMS for aerosol charging and chemical ionization were replaced by soft X-ray ionizers so that it can be operated in countries with tight regulations on radioactive materials. Protonated N-methyl-2-pyrrolidone ions were used as the positive reagent ion, which selectively detects ammonia and low-molecular weight-aliphatic amines and amides vaporized from the particle phase. With superoxide as the negative reagent ion, a wide range of inorganic and organic compounds were observed, including nitrate, sulfate, aliphatic acids with carbon numbers up to 18, and highly oxygenated CHO, CHON, and CHOS compounds. The latter two can be attributed to parent ions or the decomposition products of organonitrates and organosulfates/organosulfonates, respectively. Components from both primary emissions and secondary formation of UFPs were identified. Compared to the UFPs measured at forest and marine sites, those in urban Beijing contain more nitrogen-containing and sulfur-containing compounds. These observations illustrate unique features of the UFPs in the urban environment and provide insights into their origins.