Improving the quality of 4H silicon carbide (4H-SiC) epitaxial layers to reduce the leakage current of 4H-SiC based high-power devices is a long-standing issue in the development of 4H-SiC homoepitaxy. In this work, we compare the effect of different type of dislocations, and discriminate the effect of dislocation lines and dislocation-related pits on the leakage current of 4H-SiC by combining molten-KOH etching and the tunneling atomic force microscopy (TUNA) measurements. It is found that both the dislocation lines of threading dislocations (TDs) and the TD-related pits increase the reverse leakage current of 4H-SiC. The dislocation lines of TDs exert more significant effect on the reverse leakage current of 4H-SiC, which gives rise to the nonuniform distribution of reverse leakage current throughout the TD-related pits. Due to the different Burgers vectors of TDs, the effect of TDs on the reverse leakage current of 4H-SiC increases in the order to threading edge dislocation (TED), threading screw dislocation (TSD) and threading mixed dislocation (TMD). Basal plane dislocations (BPDs) are also found to slightly increase the reverse leakage current, with the leakage current mainly concentrated at the core of the BPD. Compared to the effect of TDs, the effect of BPDs on the reverse leakage current of 4H-SiC is negligible. Our work indicates that reducing the density of TDs, especially TMDs and TSDs, is key to improve the quality of 4H-SiC epitaxial layers and reduce the reverse leakage current of 4H-SiC based high -power devices.