A directional coupler based on a microstrip branch line for 5G millimeter wave communication is designed. The branch line structure is simple and easy to implement. The comprehensive decomposition design method of the microwave system is proposed to improve the design efficiency. Based on the theoretical analysis of microwaves, the design method of combining automatic tuning and manual tuning optimization is used to optimize the schematic simulation. The layout simulation adopts iterative optimization to approximate the design index and reduce the influence of branch line connection loss. Finally, a millimeter wave branch line directional coupler is designed with a bandwidth of 24.25ghz to 27.5ghz, a coupling degree and insertion loss of about 5dB, and an isolation degree of more than 20dB. In the coming 6G, this design method has a certain forward-looking significance.