Carbon dots (CDs) with an emission in the near infrared spectral region are attractive due to their promising applications in bio-related areas, while their fabrication still remains a challenging task. Herein, we developed a template-assisted method using porous silica microspheres for the formation of CDs with optical transitions in the near infrared. Two organic dyes, Rhodamine 6G and IR1061 with emission in the yellow and near infrared spectral regions, respectively, were used as precursors for CDs. Correlation of morphology and chemical composition with optical properties of obtained CDs revealed the origin of their emission, which is related to the CDs’ core optical transitions and dye-derivatives within CDs. By varying annealing temperature, different kinds of optical centers as derivatives of organic dyes are formed in the microsphere’s pores. The template-assisted method allows us to synthesize CDs with an emission peaked at 1085 nm and photoluminescence quantum yield of 0.2%, which is the highest value reported so far for CDs emitting at wavelengths longer than 1050 nm.