The present invention relates to the technical field of electrical engineering and discloses a PRBS disturbance injection-based power grid impedance online identification device. The device is mainly composed of a grid-connected inverter, a current loop controller, a sampling device and an impedance identification unit. The device is characterized in that the grid-connected inverter is connected with the current loop controller. When the grid-connected state is stable, the grid-connected inverter injects the PRBS disturbance into the power grid. During the injection process of a PRBS signal, a built-in output voltage THD is fed back to the controller, so that the THD value of the output voltage of the inverter is ensured to be smaller than 5%. The sampling device is connected with the PCC part of the power grid and is used for sampling and recording the voltage and the current at the PCC part of the power grid. The impedance identification unit is used for subjecting the sampled data of the sampling device to DFT analysis, and taking the average value of the amplitude and the average value of the phase of each harmonic component of the voltage and the current during the current sampling period. The method of the invention is high in precision, high in speed, strong in real-time property, wide in frequency range, lower in measuring cost and difficulty, and better in stability.