The move will see Van der Vaart return to the club he represented between 2005 and 2008.
The Holland international has signed a three-year contract.
“I am delighted that Rafael van der Vaart will be playing for Hamburg again,” said the Bundesliga club’s coach Thorsten Fink on their website.
“He will be a strong addition to our team.”
Van der Vaart’s move to Hamburg has been partly financed by a local investor.