The first stock markets appeared in Europe in the 16th and 17th centuries, mainly in port cities or trading hubs such as Antwerp, Amsterdam, and London. These early stock exchanges, however, were more akin to bond exchanges as the small number of companies did not issue equity. In fact, most early corporations were considered semi-public organizations since they had to be chartered by their government in order to conduct business.
In the late 18th century, stock markets began appearing in America, notably the New York Stock Exchange (NYSE), which allowed for equity shares to trade. The honor of the first stock exchange in America goes to the Philadelphia Stock Exchange (PHLX), which still exists today. The NYSE was founded in 1792 with the signing of the Buttonwood Agreement by 24 New York City stockbrokers and merchants. Prior to this official incorporation, traders and brokers would meet unofficially under a buttonwood tree on Wall Street to buy and sell shares.
The advent of modern stock markets ushered in an age of regulation and professionalization that now ensures buyers and sellers of shares can trust that their transactions will go through at fair prices and within a reasonable period of time. Today, there are many stock exchanges in the U.S. and throughout the world, many of which are linked together electronically. This in turn means markets are more efficient and more liquid.