Traditional controller of grid-connected inverter usually was designed after linearization of the nonlinear system, a nonlinear controller of inverter was designed directly based on differential flatness theory. Firstly, a mathematical model of grid-connected inverter was established, according to the basic definition of differential flatness theory proved that grid-connected inverter was flatness, and then the corresponding controller was designed. The controller was consist of two part: expected trajectory generation and trajectory implementation. Trajectory generation part is to plan the trajectory of state variables based the suitable flatness output of the system, and the implementation part was utilized the feedforward reference trajectory and feedback error compensation according the state equations to generate the input control variables, the dynamic performance of system was improved because of the feedforward in dominant position. Finally, a simulation model was constructed to verify the proposed control strategy.