Electromigration-induced hydrostatic elastic stress in Pb-free SnCu solder joints was studied by in situ synchrotron x-ray white beam microdiffraction. The elastic stresses in two different grains with similar crystallographic orientation, one located at the anode end and the other at the cathode end, were analyzed based on the elastic anisotropy of the β -Sn crystal structure. The stress in the grain at the cathode end remained constant except for temperature fluctuations, while the compressive stress in the grain at the anode end was builtup as a function of time during electromigration until a steady state was reached. The measured compressive stress gradient between the cathode and the anode is much larger than what is needed to initiate Sn whisker growth. The effective charge number of β -Sn derived from the electromigration data is in good agreement with the calculated value.