This paper focuses on designing and manufacturing a compact microstrip diplexer, which operates at 3.5 GHz and 5 GHz for 5G and Wi-Fi applications, respectively. Indeed, two bandpass filters are combined to create the proposed diplexer. For making bandpass filters compact, a hairpin resonator is suggested and developed into an E-shaped resonator. To attain the central frequencies, a short microstrip stub loading the E-shaped resonator is proposed. The filters were combined by a coupling junction to form the final diplexer. The proposed diplexer exhibits good isolation that is better than 40 dB in the whole operational frequency band. Additionally, the passband insertion losses are about 1 dB, and the return losses are about 20 dB and 26 dB at the two channels, respectively. Moreover, the final size of the manufactured diplexer is 30 × 25 mm 2 (0.6λ g × 0.52λ g ). These results confirm that the suggested diplexer is suitable for the demanded applications.