Two heterojunctions based on zigzag graphitic carbon nitride nanoribbons (ZCNNRs), namely, BnAn and CnAn, are considered and their electronic transport properties are studied using the nonequilibrium Green's function (NEGF) in combination with the density functional theory (DFT). The BnAn is formed by the joining of bare and partially hydrogenated ZCNNRs. The CnAn is created by the attachment of bare and fully hydrogenated ZCNNRs which leads to a Schottky barrier. The results show that current–voltage characteristics (I–V) can be significantly tuned by the length variation of heterojunctions. Furthermore, it is found that both heterojunctions have a remarkable nonlinear behavior in the whole bias range. The B4A4, B3A4, and B4A3 have forward rectifier performance whereas B2A2, B3A3, C2A2, C3A3, C4A4, C3A4, C4A3, C5A3, and C6A3 show the reverse rectification behavior. In the case of BnAn, the maximum rectification ratio (RR) of B4A4 is boosted up to 3.97 × 107 at 0.4 V. Additionally, for CnAn, the maximum RR of C4A3 can reach 1.37 × 105 at 1.0 V. Our investigation reveals that the BnAn heterojunction has negative differential resistance (NDR) under positive bias.The peculiar transport behaviors of B4A4 and C4A3 are explained due to the energy level shifts of electrodes with applied bias voltage and great alterations in the transmission spectrum. Furthermore, the Molecular projected self-consistent Hamiltonian (MPSH) and projected local density of states (PLDOS) are analyzed for these devices. The findings of this work reveal unique opportunities to design the ZCNNRs nanoelectronic devices.