An ultracompact tunable optical dense wavelength division demultiplexer (DWDM) compatible with complementary metal–oxide–semiconductor technology is proposed, consisting of a central bus waveguide coupled to two drop waveguides through two ring resonators, all made of silicon (Si). Each Si ring resonator is topped by a graphene microribbon whose chemical potential can be tuned as desired. The center wavelength of each drop channel is determined by the resonant wavelength of the adjacent ring resonator, which in turn is tuned by modifying the conductivity of the graphene. Simulations show that the proposed structure with two graphene–Si ring resonators (GSRRs) having a chemical potential difference of 210 meV demultiplexes a broad optical signal into two narrow channels centered at about 1552.42 nm and 1552.85 nm (with a channel spacing of less than 0.43 nm), each emerging from one drop waveguide, with a transmission efficiency above 64%. The full-width at half-maximum values of the channels are 160 pm and 250 pm, providing quality factors of ∼ 9705 and 6209 with crosstalk of less than − 13.3 dB. By exchanging the chemical potentials of the GSRRs, the drop channels can be swapped dynamically without mechanical manipulation of the device. The proposed ultracompact graphene-based demultiplexer enables electrically tuned optical demultiplexing for DWDM systems as a potential alternative to the thermooptically tuned demultiplexers employed in long-haul optical communications.