The invention provides an electric compressor capable of uniformizing loss and
heat generation of a switching element and coping with a wide range without enlarging the size. An electric compressor (1) is provided with an
inverter (16) that has a plurality of switching elements (18A-18F) and supplies power to a motor (8). An electric compressor (1) is provided with: a housing (2) that constitutes a motor chamber (4) in which a motor is incorporated, and an
inverter housing section (6) in which an
inverter is mounted; a partition wall (3) between the motor chamber and the inverter housing part; and a plurality of connection terminals (10A, 10B), one end of which is electrically connected to the motor, the connection terminals being provided so as to protrude from the motor in the direction of the partition wall, the connection terminals being provided so as to be dispersed and pass through the partition wall, and the other end of which is electrically connected to the inverter. The switching elements are arranged on the partition walls in a dispersed manner so as to correspond to the respective connection terminals.