Supercapacitors based on carbon nanomaterials are attracting much attention because of their high capacitance enabled by large specific surface area. The introduction of heteroatoms such as N or O enhances the specific capacitance of these materials. However, the mechanisms that lead to the increase in the specific capacitance are not yet well-studied. In this Letter, we demonstrate an effective method for modification of the surface of carbon nanowalls (CNWs) using DC plasma in atmospheres of O2, N2, and their mixture. Processing in the plasma leads to the incorporation of ∼4 atom % nitrogen and ∼10 atom % oxygen atoms. Electrochemical measurements reveal that CNWs functionalized with oxygen groups are characterized by higher capacitance. The specific capacitance for samples with oxygen reaches 8.9 F cm-3 at a scan rate of 20 mV s-1. In contrast, the nitrogen-doped samples demonstrate a specific capacitance of 4.4 F cm-3 at the same scan rate. The mechanism of heteroatom incorporation into the carbon lattice is explained using density functional theory calculations.