The basal plane of carbon materials with sp2-hybridized covalent bonds is chemically stable. However, when vacancy defects and non-metal light elements, such as boron, nitrogen, fluorine, sulfur, and phosphor, are introduced in the basal plane, their chemical and physical properties change drastically. In our study, by reacting fluorinated carbon nanomaterials with ammonia gas at 300–600 °C, we succeeded in synthesizing nitrogen-doped carbon nanomaterials (with pyridinic-, pyrrolic-, and graphitic-type nitrogen species). The nitrogen doping mechanism is as follows: when fluorinated carbon nanomaterials are heated, fluorine groups will be detached from the carbon structure along with the carbon atoms to produce carbon fluorides. Moreover, vacancy defects are formed by this process. As the edges of the resulting vacancy defects are energetically active, the active carbon atoms at the edges will react with ammonia, and nitrogen atoms will be introduced into the carbon frame. We attempt to control the surficial, chemical, and physical properties of carbon nanomaterials.