The vast majority of global stock markets in 2017 have surged either to fresh records or multiyear highs, one of the broadest rallies in years that investors say is a result of the increasingly synchronized global economic recovery.

Half of the 35 major indexes representing the world’s biggest stock markets by value have hit all-time highs this year, the most since 2007, according to an analysis by The Wall Street Journal. In the U.S., the Dow Jones Industrial Average has logged 60 record closing highs this year, the most...