Obama and his wife Michelle will however spend time with Mandela's family to comfort them in a difficult time, the official said, as the US leader arrived in Pretoria for talks with President Jacob Zuma.
"The President and First Lady will meet privately with members of the Mandela family to offer their thoughts and prayers at this difficult time," the official said on condition of anonymity.
"Out of deference to Nelson Mandela's peace and comfort and the family's wishes, they will not be visiting the hospital."
His aides had said previously they would "gauge" the situation once on the ground before deciding whether Obama would visit Mandela in the hospital where he has been clinging to life for three weeks.
The prospect of a public encounter between the first black presidents of South Africa and the United States had been eagerly awaited for years, but has now been scuppered by the 94-year-old Mandela's failing health.