Police were called to reports the Stagecoach bus had hit the bridge at Chapel Hill, near the train station, shortly before 14:00 BST.
Two people were on board the bus at the time, but were not injured.
Chapel Hill has been reopened. Network Rail said train services between Basingstoke and London, which use the bridge, had not been affected.
The roof of a double decker bus has been torn off after it struck a railway bridge in Basingstoke.