The prince met traders and security staff who helped people during the attack on 3 June.
The historic market in south London was closed for several days to allow police to carry out forensic investigations.
It re-opened on Wednesday when traders held a minute's silence to remember the victims.
Hundreds of people, including London Mayor Sadiq Khan, had gathered at the market to mark the re-opening after days of intensive cleaning and clearing by the community.
Prince Harry bought a box of doughnuts from Matt Jones, of Bread Ahead, whose staff protected members of the public on the night of the attacks.
Mr Jones said the attack "was a horrible thing", and Harry replied: "The strength of this community and London as a whole is magic."
He also praised the bravery of staff who worked in bars and restaurants around Borough Market and helped people during the assault.
Prince Harry spoke to security officer Ganga Garbuja, who was one of the first on the scene and led people to safety.
A Kensington Palace spokesman said: "Prince Harry was keen to come down as soon as possible to spread the message that this vibrant market is open for business."
Inquests into the deaths of the eight victims are being held at Southwark Coroner's Court.
Prince Harry has visited Borough Market a day after it re-opened following the London Bridge terrorist attack in which eight people died.