The welding processes of steel materials are often accompanied by the occurrence of phase transformation. Volume change caused by phase transformation will affect the history of stress and strain. In this article, taking the welding of Q345 as an example, the effects of solid-state phase transformation on the residual stress were investigated by numerical simulation. The values of thermal strain at different temperatures were set to make the volume change caused by phase transformation equivalent as thermal strain. The simulation contained two cases both considering phase transformation and not. The results show that in both two cases the longitudinal stress distribution in the weld zone has almost the same trend. But in the case without considering phase transformation, there is large longitudinal tensile stress concentrating in the weld and HAZ zone and the maximum value is up to 427MPa in the weld. For transverse stress, phase transformation not only changes the value of the stress, but also alters the sign of the stress in the middle of the weld zone. Experiment was also carried out to measure the residual stress by X-ray diffraction. The result considering phase transformation matched much better with the experimental data. It can be concluded that phase transformation in the process of welding has a significant effect on the residual stress and can not be ignored in the numerical simulation of welding.