Nitrogen-doped reduced graphene oxide (RGO) samples with different nitrogen content, prepared by two different methods, as well as nitrogen-doped few-layer graphene have been investigated as supercapacitor electrodes. Two electrode measurements have been carried out both in aqueous (6M KOH) and in ionic liquid media. Nitrogen-doped reduced graphene oxides exhibit satisfactory specific capacitance, the values reaching 126F/g at a scan rate of 10mV/s in aqueous medium. Besides providing supercapacitor characteristics, the study has shown the nitrogen content and surface area to be important factors. High surface-area borocarbonitrides, BxCyNz, prepared by the urea route appear to be excellent supercapacitor electrode materials. Thus, BC4.5N exhibits a specific capacitance of 169F/g at a scan rate of 10mV/s in aqueous medium. In an ionic liquid medium, nitrogen-doped RGO and BC4.5N exhibit specific capacitance values of 258F/g and 240F/g at a scan rate of 5mV/s. The ionic liquid enables a larger operating voltage range of 0.0-2.5V compared to 0.0-1V in aqueous medium.