McGrady's old number will go to new teammate Trevor Ariza, the Lakers forward who agreed to a multiyear deal with Houston on July 2.
McGrady wore No. 3 in high school. He is making the switch to promote his humanitarian efforts in the Darfur region of the Sudan and a documentary on his summer 2007 visits to refugee camps in the region. The documentary, "3 Points," is set for release this fall. The title refers to goals of peace, protection and punishment.
McGrady has donated $75,000 to a humanitarian project in Darfur.
He had microfracture surgery on his left knee in late February. Doctors say he needs up to 12 months to recover.