The invention discloses a frequency changer which comprises a cabinet, a modularized component and a radiator component. The modularized component is arranged in the cabinet, the radiator component is arranged outside the cabinet, the modularized component comprises an alternating-current branch device set, a direct-current branch device set, an electrical device set and a power device set, the cabinet is divided into a first cabinet and a second cabinet through a partition, the first cabinet is used for containing the alternating-current branch device set, and the second cabinet comprises a first area used for containing the electrical device set, a second area used for containing the power device set, and a third area used for containing the direct-current branch device set. The modularized component is arranged reasonably, so that the frequency changer is enabled to be more reasonable and compact in assembly structure and easy to expand, maintain, manufacture and mount. In addition, power grid composite power supply and grid-connected power generation of the frequency changer can be realized, and the frequency changer has needed using functions and is good in heat radiating performance.