The queen arrived at the King Edward VII Hospital on Wednesday hours after Buckingham Palace said Philip's condition had improved considerably and that he was in good spirits.
It is not clear if Philip will be released in time for his birthday. The prince turns 91 on Sunday.
Over the weekend, Philip joined the queen on the River Thames in blustery weather for a pageant in honor of Elizabeth's 60s years on the throne. He was taken to the hospital Monday, forcing him to miss several key events of the Diamond Jubilee celebrations, including a concert outside Buckingham Palace.
His son Prince Edward visited him on Tuesday. He said his father was feeling a lot better and had been watching Jubilee events on television.
Philip, who is also known as the Duke of Edinburgh, is a former naval officer who married the queen in 1947. His health remained robust through his 80s, but he has appeared frailer in recent years.
He was hospitalized for four nights over Christmas after suffering chest pains and underwent a successful coronary stent procedure.
The Associated Press contributed to this report.