Grid-connected inverter have been extensively used in the renewable energy grid-connect systems, such as solar and wind. Interaction between the grid and the inverter may generate harmonic resonances that lead to reduced power quality and even instability. To analyse the stability of the inverter-grid system using impedance-based stability criterion, inverter impedance has to be known. Impedance measurement in the dq-domain requires the precise synchronous phase angle to obtain accurate measurement. For impedance measurement in the stationary frame, inaccuracy usually results from not considering the effects of grid impedance and the frequency coupling. A new impedance measurement method in the stationary frame is proposed to obtain accurate measurement. The proposed method takes into account the grid impedance and its interaction with the inverter. Thus, it overcomes the limitations of current impedance measurement methods. More important, the proposed method enables accurate stability analysis results, whereas current methods may fail. Simulation and experimental results are presented to demonstrate the effectiveness of the proposed measurement method.This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.